Mnemonic | Semantics | Encoding |
---|---|---|
NOP | PC = PC + 1 | 0000 000 |
BRp <Label> | ( P) ? PC = PC + 1 + sext( |
0000 001 |
BRz <Label> | ( Z ) ? PC = PC + 1 + sext( |
0000 010 |
BRzp <Label> | ( Z|P) ? PC = PC + 1 + sext( |
0000 011 |
BRn <Label> | (N ) ? PC = PC + 1 + sext( |
0000 100 |
BRnp <Label> | (N | P) ? PC = PC + 1 + sext( |
0000 101 |
BRnz <Label> | (N|Z ) ? PC = PC + 1 + sext( |
0000 110 |
BRnzp <Label> | (N|Z|P) ? PC = PC + 1 + sext( |
0000 111 |
ADD |
0001 |
|
MUL |
0001 |
|
SUB |
0001 |
|
DIV |
0001 |
|
ADD |
0001 |
|
CMP |
NZP = sign( |
0010 |
CMPU |
NZP = sign( |
0010 |
CMPI |
NZP = sign( |
0010 |
CMPIU |
NZP = sign( |
0010 |
JSRR |
R7 = PC + 1; PC = |
0100 0 |
JSR <Label> | R7 = PC + 1; PC = (PC & 0x8000) | ( |
0100 1 |
AND |
0101 |
|
NOT |
0101 |
|
OR |
0101 |
|
XOR |
0101 |
|
AND |
0101 |
|
LDR |
0110 |
|
STR |
dmem[ |
0111 |
RTI | PC = R7; PSR [15] = 0 | 1000 |
CONST |
1001 |
|
SLL |
1010 |
|
SRA |
1010 |
|
SRL |
1010 |
|
MOD |
1010 |
|
JMPR |
PC = |
1100 0 |
JMP <Label> | PC = PC + 1 + sext( |
1100 1 |
HICONST |
1101 |
|
TRAP |
1111 xxxx |
Pseudo-Instructions | ||
---|---|---|
RET | Return to R7 | JMPR R7 |
LEA |
Store address of <Label> in |
CONST/HICONST |
LC |
Store value of <Label> in |
CONST/HICONST |
Assembler Directives | |
---|---|
.CODE | Current memory section contains instruction code |
.DATA | Current memory section contains data values |
.ADDR | Set current memory address to |
.FALIGN | Pad current memory address to next multiple of 16 |
.FILL | Set current memory address's value to |
.STRINGZ "String" | Expands to a .FILL for each character in String |
.BLKW | Reserve |
<Label> .CONST | Associate <Label> with |
<Label> .UCONST | Associate <Label> with |
Legend | |
---|---|
0101 | opcode/sub-opcode |
destination register | |
source register 1 | |
source register 2 | |
signed immediate value | |
unsigned immediate value | |
"don't care" value | |
sign( | +1, 0, or -1, depending on the sign of the subtraction. The registers are treated as |
sign( | +1, 0, or -1, depending on the sign of the subtraction. The registers are treated as |
NZP | Negative, Zero, and Positive bits from the processor's status register. They are set based on the value of the compare operations, and by any instruction that writes to a register. In the case of registers updating the NZP bits, the value set in the NZP register corresponds to the sign of the value written to the register (+1, 0, -1). |