Hex Code: | 6J | 00 | 00 | RR | 00 | SS | 00 | 00 |   unconditional, indirect set |
6J | M0 | XX | RR | 00 | SS | 00 | YY |   M=1-7, Compare register XX to register YY, indirect set |
6J | M0 | XX | RR | 00 | SS | KK | KK |   M=9-F, Compare register XX to constant KKKK, indirect set |
6J | 0K | 00 | RR | 00 | SS | HH | LL |   unconditional, indirect set, K=1,4-7 Set then Link |
7J | 00 | 00 | RR | SS | SS | 00 | 00 |   unconditional, direct set |
7J | M0 | XX | RR | SS | SS | 00 | YY |   M=1-7, Compare register XX to register YY, direct set |
7J | M0 | XX | RR | SS | SS | KK | KK |   M=9-F, Compare register XX to constant KKKK, direct set |
7J | 0K | 00 | RR | SS | SS | HH | LL |   unconditional, direct set, K=1,4-7 Set then Link |
Action: | The Set command sets the destination register "RR" (byte 3) to the result of the operation "J", listed below.
The indirect form uses GPRM or SPRM denoted by "SS" (byte 5) as the source, as allowed by the operation.
The direct form uses the constant "SSSS" (bytes 4&5) as the source value, if allowed by the operation.
If "K" is 1, 4, 5, 6, or 7 the Set is followed by a link command. |
Order: | If a compare is specified, it is performed first. If the conditions are met the Set is executed. |
Comments: | While this command allows the use of separate registers and constants for set and compare,
and also allows the full range of link commands, it can not combine compare and link in the same command.
The related command SetCLnk (set and conditionally link) can combine compare and link, but shares a
register in common with set and compare, and is limited to the link subset.
Related commands CSetCLnk (conditionally set and link) and CSetLnk
(conditionally set, unconditionally link) can combine compare and link, do not share registers but are limited to one constant
for either set or compare, and are limited to the link subset. |
Set operation codes | Source may be |
J | Mnemonics | Operation | GPRM | SPRM | constant |
1 | =   mov | set destination GPRM to source value | | | |
2 | <->   swp | swap destination GPRM with source GPRM | |   |   |
3 | +=   add | add source value to destination GPRM | |   | |
4 | -=   sub | subtract source value from destination GPRM | |   | |
5 | *=   mul | multiply destination GPRM by source value | |   | |
6 | /=   div | divide destination GPRM by source value | |   | |
7 | %=   mod | set destination GPRM to destination register modulo source value | |   | |
8 | ?=   rnd | set destination GPRM to a random value between 1 and the source value | |   | |
9 | &=   and | and destination GPRM with source value | | | |
A | |=   or | or destination GPRM with source value | | | |
B | ^=   xor | xor destination GPRM with source value | | | |
Compare operation codes |
register to register | register to constant | Alternate mnemonic | Comments |
M | operation | M | operation |
1 | RegX & RegY | 9 | RegX & K | BC | Bitwise compare, the two operands are anded, if the result is non-zero the condition is true |
2 | RegX == RegY | A | RegX == K | EQ | If the two operands are equal the condition is true |
3 | RegX != RegY | B | RegX != K | NE | If the two operands are not equal the condition is true |
4 | RegX >= RegY | C | RegX >= K | GE | If RegX is greater than or equal to the right operand the condition is true |
5 | RegX > RegY | D | RegX > K | GT | If RegX is greater than the right operand the condition is true |
6 | RegX <= RegY | E | RegX <= K | LE | If RegX is less than or equal to the right operand the condition is true |
7 | RegX < RegY | F | RegX < K | LT | If RegX is less than the right operand the condition is true |