OPCODE: 11101
has operand is set:
value1 is less than value2:
-1 at the address SB + SP wherevalue1 is greater than value2:
1 at the address SB + SP wherevalue1 is equal to value2:
0 at the address SB + SP whereSB is the address of the stack base, and SP
the stack pointer register
SP register by X| Instruction | Value for X |
|---|---|
| CMP8 | 1 |
| CMP16 | 2 |
| CMP32 | 4 |
| CMP64 | 8 |
CMP8 4 5 CMP8 5 4 CMP8 5 5
⇩
CMP8 (1 11101 00) | 4 | 5 |
CMP8 (1 11101 00) | 5 | 4 |
CMP8 (1 11101 00) | 5 | 5 |
⇩
STACK HEAD (SP = 3) |
|---|
| 0 |
| 1 |
| -1 |
| STACK BASE |