BKCMP Block Comparison Operation
Relational operators (Block comparison)
Relational operators compare two values or strings to provide a true and false result.
| |
S1 | Value to compare |
S2 | Value to compare |
D | Destination where comparison result is stored |
n | Number of block for comparison |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. | Error | Zero | Carry | |||
BKCMP BKCMPP | S1 | o | o | o | o | o | o | o | o | - | o | o | o | o | 5 | o | - | - |
S2 | o | o | o | o | o | o | o | o | - | o | o | o | o | |||||
D | o | - | o | o | o | - | o | o | - | o | o | o | o | |||||
n | o | o | o | o | o | o | o | o | o | o | o | o | o |
Compare n number of S1 and n number of S2 and save the result to the Destination.
If the result is true then the assigned bit on D will be turned ON.
If the result is false then the assigned bit on D will be turned OFF.
Comparison | Operator | Result |
BKCMP< Less than | S1 < S2 | ON |
BKCMP<= Less than or equal | S1 <= S2 | ON |
BKCMP= equal to | S1 = S2 | ON |
BKCMP> Greater than | S1 > S2 | ON |
BKCMP>= Greater than or equal | S1 >= S2 | ON |
BKCMP<> Not equal | S1 ≠ S2 | ON |
Example)
If X00 is ON and D0, D1 and D2 are less than D10, D11 and D13 then set the D100, D101 and D103 to 1 in sequence.