In the instruction descriptions below, the following notation is used.
- Rd
-
Destination register number "d" in the general registers.
- Ra
-
First source register number "a" in the general registers.
- Rb
-
Second source register number "b" in the general registers.
- PC
-
The program counter
- I
-
Unsigned immediate value
- S
-
Signed immediate value
- dmem[i]
-
Byte offset "i" in the data memory.
- imem[i]
-
Word offset "i" in the code memory.
- carry
-
The carry flag.
- SignExt(x)
-
The value "x" (which may be one of the above) sign extended as necessary.
Individual bits in the encodings are used as follows.
0-
A zero bit.
1-
A one bit.
- dn
-
Bit "n" of the destination register field.
- an
-
Bit "n" of the the first source register field.
- bn
-
Bit "n" of the the second source register field.
- in
-
Bit "n" of the the unsigned constant field.
- sn
-
Bit "n" of the the signed constant field.
The assembler generally follows standard GNU assembler conventions. Instructions take the following form:
-
[label
:] opcode [arguments]
There may be up to 3 arguments, separated by commas. Registers are
indicted by R followed by a number. Constants
and constant expressions may be preceded by # for
clarity, but this is not required. C style notation to indicate the
base of constants, which defaults to decimal.
The 16-bit instruction formats are shown in Figure 3.1 and the 32-bit instruction formats in Figure 3.2.
Figure 3.1. AAP 16-bit instruction formats.
Figure 3.2. AAP 32-bit instruction formats.
Longer instruction formats are possible by setting the top bit of the
second word to 1. By repeating this,
instructions of arbitrary length are possible.
-
Table 3.1 lists all the 16-bit ALU instructions, which have class
00; -
Table 3.2 lists all the 16-bit load/store instructions, which have class
01; -
Table 3.3 lists all the 16-bit branch/jump instructions, which have class
10; and -
Table 3.4 lists all the 16-bit miscellaneous instructions, which have class
11.
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
NOP Rd,I
| 5 |
0000000dddiiiiii
| No operation | |||||
ADD Rd,Ra,Rb
| 1 |
0000001dddaaabbb
| Unsigned add | |||||
SUB Rd,Ra,Rb
| 1 |
0000010dddaaabbb
| Unsigned subtract | |||||
AND Rd,Ra,Rb
| 1 |
0000011dddaaabbb
| Bitwise AND | |||||
OR Rd,Ra,Rb
| 1 |
0000100dddaaabbb
| Bitwise OR | |||||
XOR Rd,Ra,Rb
| 1 |
0000101dddaaabbb
| Bitwise exclusive OR | |||||
ASR Rd,Ra,Rb
| 1 |
0000110dddaaabbb
| Arithmetic shift right | |||||
LSL Rd,Ra,Rb
| 1 |
0000111dddaaabbb
| Logical shift left | |||||
LSR Rd,Ra,Rb
| 1 |
0001000dddaaabbb
| Logical shift right | |||||
MOV Rd,Ra
| 1 |
0001001dddaaa000
| Move register to register | |||||
ADDI Rd,Ra,#I
| 2 |
0001010dddaaaiii
| Unsigned add immediate | |||||
SUBI Rd,Ra,#I
| 2 |
0001011dddaaaiii
| Unsigned subtract immediate | |||||
ASRI Rd,Ra,#I
| 2 |
0001100dddaaaiii
| Arithmetic shift right immediate | |||||
LSLI Rd,Ra,#I
| 2 |
0001101dddaaaiii
| Logical shift left immediate | |||||
LSRI Rd,Ra,#I
| 2 |
0001110dddaaaiii
| Logical shift right immediate | |||||
MOVI Rd,#I
| 5 |
0001111dddiiiiii
| Move immediate to register | |||||
Table 3.1. 16-bit ALU instructions
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
LDB Rd,(Ra,S)
| 4 |
0010000dddaaasss
| Indexed load byte | |||||
LDW Rd,(Ra,S)
| 4 |
0010100dddaaasss
| Indexed load word | |||||
LDB Rd,(Ra+,S)
| 4 |
0010001dddaaasss
| Indexed load byte with postincrement | |||||
LDW Rd,(Ra+,S)
| 4 |
0010101dddaaasss
| Indexed load word with postincrement | |||||
LDB Rd,(-Ra,S)
| 4 |
0010010dddaaasss
| Indexed load byte with predecrement | |||||
LDW Rd,(-Ra,S)
| 4 |
0010110dddaaasss
| Indexed load word with predecrement | |||||
STB (Rd,S),Ra
| 4 |
0011000dddaaasss
| Indexed store byte | |||||
STW (Rd,S),Ra
| 4 |
0011100dddaaasss
| Indexed store word | |||||
STB (Rd+,S),Ra
| 4 |
0011001dddaaasss
| Indexed store byte with postincrement | |||||
STW (Rd+,S),Ra
| 4 |
0011101dddaaasss
| Indexed store word with postincrement | |||||
STB (-Rd,S),Ra
| 4 |
0011010dddaaasss
| Indexed store byte with predecrement | |||||
STW (-Rd,S),Ra
| 4 |
0011110dddaaasss
| Indexed store word with predecrement | |||||
Table 3.2. 16-bit load/store instructions
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
BRA S
| 7 |
0100000sssssssss
| Relative branch | |||||
BAL S,Rb
| 6 |
0100001ssssssbbb
| Relative branch and link | |||||
BEQ S,Ra,Rb
| 3 |
0100010sssaaabbb
| Relative branch if equal | |||||
BNE S,Ra,Rb
| 3 |
0100011sssaaabbb
| Relative branch if not equal | |||||
BLTS S,Ra,Rb
| 3 |
0100100sssaaabbb
| Relative branch if signed less than | |||||
BLES S,Ra,Rb
| 3 |
0100101sssaaabbb
| Relative branch if signed less than or equal to | |||||
BLTU S,Ra,Rb
| 3 |
0100110sssaaabbb
| Relative branch if unsigned less than | |||||
BLEU S,Ra,Rb
| 3 |
0100111sssaaabbb
| Relative branch if unsigned less than or equal to | |||||
JMP Rd
| 1 |
0101000ddd000000
| Absolute jump | |||||
JAL Rd,Rb
| 1 |
0101001ddd000bbb
| Absolute jump and link | |||||
JEQ Rd,Ra,Rb
| 1 |
0101010dddaaabbb
| Absolute jump if equal | |||||
JNE Rd,Ra,Rb
| 1 |
0101011dddaaabbb
| Absolute jump if not equal | |||||
JLTS Rd,Ra,Rb
| 1 |
0101100dddaaabbb
| Absolute jump if signed less than | |||||
JLES Rd,Ra,Rb
| 1 |
0101101dddaaabbb
| Absolute jump if signed less than or equal to | |||||
JLTU Rd,Ra,Rb
| 1 |
0101110dddaaabbb
| Absolute jump if unsigned less than | |||||
JLEU Rd,Ra,Rb
| 1 |
0101111dddaaabbb
| Absolute jump if unsigned less than or equal to | |||||
Table 3.3. 16-bit branch/jump instructions
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
RTE Rd
| 1 |
0110000ddd000000
| Return from exception | |||||
Table 3.4. Miscellaneous 16-bit instructions
In the following list, the encoding is shown with the word at the lower address first.
-
Table 3.5 lists all the 32-bit ALU instructions, which have class
00xx; -
Table 3.6 lists all the 32-bit load/store instructions, which have class
01xx; -
Table 3.7 lists all the 32-bit branch/jump instructions, which have class
10xx; and -
There are no 32-bit instructions in the miscellaneous class, but if there were, they would have have class
11xx.
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
NOP Rd,I
| 14 |
1000000dddiiiiii
| No operation | |||||
0000000dddiiiiii
| ||||||||
ADD Rd,Ra,Rb
| 8 |
1000001dddaaabbb
| Unsigned add | |||||
0000000dddaaabbb
| ||||||||
SUB Rd,Ra,Rb
| 8 |
1000010dddaaabbb
| Unsigned subtract | |||||
0000000dddaaabbb
| ||||||||
AND Rd,Ra,Rb
| 8 |
1000011dddaaabbb
| Bitwise AND | |||||
0000000dddaaabbb
| ||||||||
OR Rd,Ra,Rb
| 8 |
1000100dddaaabbb
| Bitwise OR | |||||
0000000dddaaabbb
| ||||||||
XOR Rd,Ra,Rb
| 8 |
1000101dddaaabbb
| Bitwise exclusive OR | |||||
0000000dddaaabbb
| ||||||||
ASR Rd,Ra,Rb
| 8 |
1000110dddaaabbb
| Arithmetic shift right | |||||
0000000dddaaabbb
| ||||||||
LSL Rd,Ra,Rb
| 8 |
1000111dddaaabbb
| Logical shift left | |||||
0000000dddaaabbb
| ||||||||
LSR Rd,Ra,Rb
| 8 |
1001000dddaaabbb
| Logical shift right | |||||
0000000dddaaabbb
| ||||||||
MOV Rd,Ra
| 8 |
1001001dddaaa000
| Move register to register | |||||
0000000dddaaa000
| ||||||||
ADDI Rd,Ra,I
| 11 |
1001010dddaaaiii
| Unsigned add immediate | |||||
000iiiidddaaaiii
| ||||||||
SUBI Rd,Ra,I
| 11 |
1001011dddaaaiii
| Unsigned subtract immediate | |||||
000iiiidddaaaiii
| ||||||||
ASRI Rd,Ra,I
| 9 |
1001100dddaaaiii
| Arithmetic shift right immediate | |||||
0000000dddaaaiii
| ||||||||
LSLI Rd,Ra,I
| 9 |
1001101dddaaaiii
| Logical shift left immediate | |||||
0000000dddaaaiii
| ||||||||
LSRI Rd,Ra,I
| 9 |
1001110dddaaaiii
| Logical shift right immediate | |||||
0000000dddaaaiii
| ||||||||
MOVI Rd,I
| 15 |
1001111dddiiiiii
| Move immediate to register | |||||
000iiiidddiiiiii
| ||||||||
ADDC Rd,Ra,Rb
| 8 |
1000001dddaaabbb
| Add with carry | |||||
0000001dddaaabbb
| ||||||||
SUBC Rd,Ra,Rb
| 8 |
1000010dddaaabbb
| Subtract with carry | |||||
0000001dddaaabbb
| ||||||||
ANDI Rd,Ra,I
| 10 |
1000011dddaaaiii
| Bitwise AND immediate | |||||
000iii1dddaaaiii
| ||||||||
ORI Rd,Ra,I
| 10 |
1000100dddaaaiii
| Bitwise OR immediate | |||||
000iii1dddaaaiii
| ||||||||
XORI Rd,Ra,I
| 10 |
1000101dddaaaiii
| Bitwise exclusive OR immediate | |||||
000iii1dddaaaiii
| ||||||||
Table 3.5. 32-bit ALU instructions
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
LDB Rd,(Ra,S)
| 13 |
1010000dddaaasss
| Indexed load byte | |||||
000ssssdddaaasss
| ||||||||
LDW Rd,(Ra,S)
| 13 |
1010100dddaaasss
| Indexed load word | |||||
000ssssdddaaasss
| ||||||||
LDB Rd,(Ra+,S)
| 13 |
1010001dddaaasss
| Indexed load byte with postincrement | |||||
000ssssdddaaasss
| ||||||||
LDW Rd,(Ra+,S)
| 13 |
1010101dddaaasss
| Indexed load word with postincrement | |||||
000ssssdddaaasss
| ||||||||
LDB Rd,(-Ra,S)
| 13 |
1010010dddaaasss
| Indexed load byte with predecrement | |||||
000ssssdddaaasss
| ||||||||
LDW Rd,(-Ra,S)
| 13 |
1010110dddaaasss
| Indexed load word with predecrement | |||||
000ssssdddaaasss
| ||||||||
STB (Rd,S),Ra
| 13 |
1011000dddaaasss
| Indexed store byte | |||||
000ssssdddaaasss
| ||||||||
STW (Rd,S),Ra
| 13 |
1011100dddaaasss
| Indexed store word | |||||
000ssssdddaaasss
| ||||||||
STB (Rd+,S),Ra
| 13 |
1011001dddaaasss
| Indexed store byte with postincrement | |||||
000ssssdddaaasss
| ||||||||
STW (Rd+,S),Ra
| 13 |
1011101dddaaasss
| Indexed store word with postincrement | |||||
000ssssdddaaasss
| ||||||||
STB (-Rd,S),Ra
| 13 |
1011010dddaaasss
| Indexed store byte with predecrement | |||||
000ssssdddaaasss
| ||||||||
STW (-Rd,S),Ra
| 13 |
1011111dddaaasss
| Indexed store word with predecrement | |||||
000ssssdddaaasss
| ||||||||
Table 3.6. 32-bit load/store instructions
| Opcode | Format | Encoding | Description | |||||
|---|---|---|---|---|---|---|---|---|
BRA S
| 17 |
1100000sssssssss
| Relative branch | |||||
000sssssssssssss
| ||||||||
BAL S,Rb
| 16 |
1100001ssssssbbb
| Relative branch and link | |||||
000ssssssssssbbb
| ||||||||
BEQ S,Ra,Rb
| 12 |
1100010sssaaabbb
| Relative branch if equal | |||||
000sssssssaaabbb
| ||||||||
BNE S,Ra,Rb
| 12 |
1100011sssaaabbb
| Relative branch if not equal | |||||
000sssssssaaabbb
| ||||||||
BLTS S,Ra,Rb
| 12 |
1100100sssaaabbb
| Relative branch if signed less than | |||||
000sssssssaaabbb
| ||||||||
BLES S,Ra,Rb
| 12 |
1100101sssaaabbb
| Relative branch if signed less than or equal to | |||||
000sssssssaaabbb
| ||||||||
BLTU S,Ra,Rb
| 12 |
1100110sssaaabbb
| Relative branch if unsigned less than | |||||
000sssssssaaabbb
| ||||||||
BLEU S,Ra,Rb
| 12 |
1100111sssaaabbb
| Relative branch if unsigned less than or equal to | |||||
000sssssssaaabbb
| ||||||||
JMP Rd
| 8 |
1101000ddd000000
| Absolute jump | |||||
0000000ddd000000
| ||||||||
JAL Rd,Rb
| 8 |
1101001ddd000bbb
| Absolute jump and link | |||||
0000000ddd000bbb
| ||||||||
JEQ Rd,Ra,Rb
| 8 |
1101010dddaaabbb
| Absolute jump if equal | |||||
0000000dddaaabbb
| ||||||||
JNE Rd,Ra,Rb
| 8 |
1101011dddaaabbb
| Absolute jump if not equal | |||||
0000000dddaaabbb
| ||||||||
JLTS Rd,Ra,Rb
| 8 |
1101100dddaaabbb
| Absolute jump if signed less than | |||||
0000000dddaaabbb
| ||||||||
JLES Rd,Ra,Rb
| 8 |
1101101dddaaabbb
| Absolute jump if signed less than or equal to | |||||
0000000dddaaabbb
| ||||||||
JLTU Rd,Ra,Rb
| 8 |
1101110dddaaabbb
| Absolute jump if unsigned less than | |||||
0000000dddaaabbb
| ||||||||
JLEU Rd,Ra,Rb
| 8 |
1101111dddaaabbb
| Absolute jump if unsigned less than or equal to | |||||
0000000dddaaabbb
| ||||||||
JMPL Rd
| 8 |
1101000ddd000000
| Absolute jump long | |||||
0000001ddd000000
| ||||||||
JALL Rd,Rb
| 8 |
1101001ddd000bbb
| Absolute jump long and link | |||||
0000001ddd000bbb
| ||||||||
JEQL Rd,Ra,Rb
| 8 |
1101010dddaaabbb
| Absolute jump long if equal | |||||
0000001dddaaabbb
| ||||||||
JNEL Rd,Ra,Rb
| 8 |
1101011dddaaabbb
| Absolute jump long if not equal | |||||
0000001dddaaabbb
| ||||||||
JLTSL Rd,Ra,Rb
| 8 |
1101100dddaaabbb
| Absolute jump long if signed less than | |||||
0000001dddaaabbb
| ||||||||
JLESL Rd,Ra,Rb
| 8 |
1101101dddaaabbb
| Absolute jump long if signed less than or equal to | |||||
0000001dddaaabbb
| ||||||||
JLTUL Rd,Ra,Rb
| 8 |
1101110dddaaabbb
| Absolute jump long if unsigned less than | |||||
0000001dddaaabbb
| ||||||||
JLEUL Rd,Ra,Rb
| 8 |
1101111dddaaabbb
| Absolute jump long if unsigned less than or equal to | |||||
0000001dddaaabbb
| ||||||||
Table 3.7. 32-bit branch/jump instructions
Encoding (format 5):
0 | 0 | 0 | 0 | 0 | 0 | 0 | d2 | d1 | d0 | i5 | i4 | i3 | i2 | i1 | i0 |
Syntax:
-
NOPRd,I
Constraints:
-
d ≤ 7
-
I ≤ 63
Outcome:
-
PC ← PC + 1
Notes:
-
This opcode may trigger side-effects in implementations, depending on the value of I, particularly when simulating (see Section 2.3).
All implementations should use d = 0, I = 0 as the break instruction for debugging, which should halt the processor.
All implementations should use d = 0, I = 1 as a true no-operation instruction.
The rationale behind this decision is that in an erroneous program, the most likely value to be encountered as a random instruction is zero, which will stop the processor.
Encoding (format 1):
0 | 0 | 0 | 0 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
ADDRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra + Rb
carry ← ( ( Ra + Rb ) ≥ 216 ) ? 1 : 0
PC ← PC + 1
Encoding (format 1):
0 | 0 | 0 | 0 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
SUBRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra - Rb
-
carry ← ( Rb > Ra ) ? 1 : 0
-
PC ← PC + 1
Encoding (format 1):
0 | 0 | 0 | 0 | 0 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
ANDRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra & Rb
-
PC ← PC + 1
Encoding (format 1):
0 | 0 | 0 | 0 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
ORRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra | Rb
-
PC ← PC + 1
Encoding (format 1):
0 | 0 | 0 | 0 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
XORRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra ^ Rb
-
PC ← PC + 1
Encoding (format 1):
0 | 0 | 0 | 0 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
ASRRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← ( Ra | ( carry << 16 ) ) >> Rb )
-
carry ← 0
-
PC ← PC + 1
Notes:
-
If Rb ≥ 17 the result in Rd will be zero.
-
The carry flag is always cleared, even if a shift of zero is specified.
Encoding (format 1):
0 | 0 | 0 | 0 | 1 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
LSLRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra << Rb
-
PC ← PC + 1
Notes:
-
If Rb ≥ 16 the result in Rd will be zero.
Encoding (format 1):
0 | 0 | 0 | 1 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
LSRRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra >> Rb
-
PC ← PC + 1
Notes:
-
If Rb ≥ 16 the result in Rd will be zero.
Encoding (format 1):
Syntax:
-
MOVRd,Ra
Constraints:
-
a ≤ 7
-
d ≤ 7
Outcome:
-
Rd ← Ra
-
PC ← PC + 1
Encoding (format 2):
0 | 0 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
Syntax:
-
ADDIRd,Ra,I
Constraints:
-
a ≤ 7
-
d ≤ 7
-
I ≤ 7
Outcome:
-
Rd ← Ra + I
carry ← ( ( Ra + I ) ≥ 216 ) ? 1 : 0
PC ← PC + 1
Notes:
-
Adding constant zero can be used to clear the carry flag.
Encoding (format 2):
0 | 0 | 0 | 1 | 0 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
Syntax:
-
SUBIRd,Ra,I
Constraints:
-
a ≤ 7
-
d ≤ 7
-
I ≤ 7
Outcome:
-
Rd ← Ra - I
-
carry ← ( I > Ra ) ? 1 : 0
-
PC ← PC + 1
Encoding (format 2):
0 | 0 | 0 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
Syntax:
-
ASRIRd,Ra,I
Constraints:
-
a ≤ 7
-
d ≤ 7
-
1 ≤ I ≤ 8
Outcome:
-
Rd ← ( Ra | ( carry << 16 ) ) >> I )
-
carry ← 0
-
PC ← PC + 1
Notes:
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 2):
0 | 0 | 0 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
Syntax:
-
LSLIRd,Ra,I
Constraints:
-
a ≤ 7
-
d ≤ 7
-
1 ≤ I ≤ 8
Outcome:
-
Rd ← Ra << I
-
PC ← PC + 1
Notes:
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 2):
0 | 0 | 0 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
Syntax:
-
LSRIRd,Ra,I
Constraints:
-
a ≤ 7
-
d ≤ 7
-
1 ≤ I ≤ 8
Outcome:
-
Rd ← Ra >> I
-
PC ← PC + 1
Notes:
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 4):
0 | 0 | 1 | 0 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDBRd,(Ra,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← dmem[Ra + SignExt(S)]
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 0 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDWRd,(Ra,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← dmem [Ra + SignExt(S)] | (dmem[Ra + SignExt(S) + 1] << 8)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 0 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDBRd,(Ra+,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← dmem[Ra + SignExt(S)]
-
Ra ← Ra + SignExt(S)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 0 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDWRd,(Ra+,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← dmem[Ra + SignExt(S)] | (dmem[Ra + SignExt(S) + 1] << 8)
-
Ra ← Ra + SignExt(S)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 0 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDBRd,(-Ra,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Ra ← Ra - SignExt(S)
-
Rd ← dmem[Ra]
-
PC ← PC + 1
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 0 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
LDWRd,(-Ra,S)
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Ra ← Ra - SignExt(S)
-
Rd ← dmem[Ra] | (dmem[Ra + 1] << 8)
-
PC ← PC + 1
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STB (Rd,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STW (Rd,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
dmem[Rd + SignExt(S) + 1] ← (Ra >> 8)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STB (Rd+,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
Rd ← Rd + SignExt(S)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STW (Rd+,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
dmem[Rd + SignExt(S) + 1] ← (Ra >> 8)
-
Rd ← Rd + SignExt(S)
-
PC ← PC + 1
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STB (-Rd,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← Rd - SignExt(S)
-
dmem[Rd] ← (Ra & 255)
-
PC ← PC + 1
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 4):
0 | 0 | 1 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
Syntax:
-
STW (-Rd,S),Ra
Constraints:
-
d ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
Rd ← Rd - SignExt(S)
-
dmem[Rd] ← (Ra & 255)
-
dmem[Rd + 1] ← (Ra >> 8)
-
PC ← PC + 1
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
![]() | Note |
|---|---|
|
The only branch/jump comparisons provided are for "equal", "not equal", "less than" and "greater than". Branch/jump comparisons for "less than or equal" and "greater than or equal" can be provided by using "greater than" and "less than" respectively in the opposite direction." Purists will point out that this reduces the opportunity for branch prediction and pipeline preservation. However the limited instruction space means not all opcodes can be provided. |
Encoding (format 7):
0 | 1 | 0 | 0 | 0 | 0 | 0 | s8 | s7 | s6 | s5 | s4 | s3 | s2 | s1 | s0 |
Syntax:
-
BRAS
Constraints:
-
-256 ≤ S ≤ 255
Outcome:
-
PC ← PC + SignExt(S)
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 6):
0 | 1 | 0 | 0 | 0 | 0 | 1 | s5 | s4 | s3 | s2 | s1 | s0 | b2 | b1 | b0 |
Syntax:
-
BALS,Rb
Constraints:
-
b ≤ 7
-
-32 ≤ S ≤ 31
Outcome:
-
Rb ← PC + 1
-
PC ← PC + SignExt(S)
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 0 | 1 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BEQS,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra = Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 0 | 1 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BNES,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra ≠ Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 1 | 0 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BLTSS,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra < Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 1 | 0 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BLESS,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra ≤ Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 1 | 1 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BLTUS,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra < Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 3):
0 | 1 | 0 | 0 | 1 | 1 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
BLEUS,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
-4 ≤ S ≤ 3
Outcome:
-
PC ← (Ra ≤ Rb) ? PC + SignExt(S) : PC + 1
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 1):
Syntax:
-
JMPRd
Constraints:
-
d ≤ 7
Outcome:
-
PC ← Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 1):
Syntax:
-
JALRd,Rb
Constraints:
-
b ≤ 7
-
d ≤ 7
Outcome:
-
Rb ← PC + 1
-
PC ← Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JEQRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra = Rb) ? Rd : PC + 1
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JNERd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra ≠ Rb) ? Rd : PC + 1
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JLTSRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra < Rb) ? Rd : PC + 1
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JLESRd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra ≤ Rb) ? Rd : PC + 1
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JLTURd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra < Rb) ? Rd : PC + 1
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 1):
0 | 1 | 0 | 1 | 1 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
Syntax:
-
JLEURd,Ra,Rb
Constraints:
-
a ≤ 7
-
b ≤ 7
-
d ≤ 7
Outcome:
-
PC ← (Ra ≤ Rb) ? Rd : PC + 1
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
At this time, this section is incomplete.
Encoding (format 14, first word at lower address):
1 | 0 | 0 | 0 | 0 | 0 | 0 | d2 | d1 | d0 | i5 | i4 | i3 | i2 | i1 | i0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | i11 | i10 | i9 | i8 | i7 | i6 |
Syntax:
-
NOPRd,I
Constraints:
-
d ≤ 63
-
I ≤ 4095
Outcome:
-
PC ← PC + 1
Notes:
-
This opcode may trigger side-effects in implementations, depending on the value of I, particularly when simulating (see Section 2.3).
-
There are no conventions for any values of d or I for the 32-bit version of NOP.
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
ADDRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra + Rb
carry ← ( ( Ra + Rb ) ≥ 216 ) ? 1 : 0
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
SUBRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra - Rb
-
carry ← ( Rb > Ra ) ? 1 : 0
-
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 0 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
ANDRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra & Rb
-
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
ORRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra | Rb
-
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
XORRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra ^ Rb
-
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
ASRRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← ( Ra | ( carry << 16 ) ) >> Rb )
-
carry ← 0
-
PC ← PC + 2
Notes:
-
If Rb ≥ 17 the result in Rd will be zero.
-
The carry flag is always cleared, even if a shift of zero is specified.
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 1 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
LSLRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra << Rb
-
PC ← PC + 2
Notes:
-
If Rb ≥ 16 the result in Rd will be zero.
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 1 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
LSRRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra >> Rb
-
PC ← PC + 2
Notes:
-
If Rb ≥ 16 the result in Rd will be zero.
Encoding (format 8, first word at lower address):
Syntax:
-
MOVRd,Ra
Constraints:
-
a ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra
-
PC ← PC + 2
Encoding (format 11, first word at lower address):
1 | 0 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | i9 | i8 | i7 | i6 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
ADDIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
I ≤ 63
Outcome:
-
Rd ← Ra + I
carry ← ( ( Ra + I ) ≥ 216 ) ? 1 : 0
PC ← PC + 2
Notes:
-
Adding constant zero can be used to clear the carry flag.
Encoding (format 11, first word at lower address):
1 | 0 | 0 | 1 | 0 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | i9 | i8 | i7 | i6 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
SUBIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
I ≤ 63
Outcome:
-
Rd ← Ra - I
-
carry ← ( I > Ra ) ? 1 : 0
-
PC ← PC + 2
Encoding (format 9, first word at lower address):
1 | 0 | 0 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
ASRIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
1 ≤ I ≤ 64
Outcome:
-
Rd ← ( Ra | ( carry << 16 ) ) >> I )
-
carry ← 0
-
PC ← PC + 2
Notes:
-
If I ≥ 17 the result in Rd will be zero.
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0000002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 9, first word at lower address):
1 | 0 | 0 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
LSLIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
1 ≤ I ≤ 64
Outcome:
-
Rd ← Ra << I
-
PC ← PC + 2
Notes:
-
If I ≥ 16 the result in Rd will be zero.
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0000002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 9, first word at lower address):
1 | 0 | 0 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
LSRIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
1 ≤ I ≤ 64
Outcome:
-
Rd ← Ra >> I
-
PC ← PC + 2
Notes:
-
If I ≥ 16 the result in Rd will be zero.
-
The shift is encoded with a value 1 less than specified (i.e. a shift of 1 is encoded as 0000002. The rationale is that shifting by zero is pointless. It is not needed to clear the carry flag, since there are other ways of clearing the it (for example adding constant zero).
Encoding (format 15, first word at lower address):
1 | 0 | 0 | 1 | 1 | 1 | 1 | d2 | d1 | d0 | i5 | i4 | i3 | i2 | i1 | i0 |
0 | 0 | 0 | i15 | i14 | i13 | i12 | d5 | d4 | d3 | i11 | i10 | i9 | i8 | i7 | i6 |
Syntax:
-
MOVIRd,I
Constraints:
-
d ≤ 63
-
I ≤ 65535
Outcome:
-
Rd ← I
-
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
ADDCRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra + Rb + carry
carry ← ( ( Ra + Rb + carry) ≥ 216 ) ? 1 : 0
PC ← PC + 2
Encoding (format 8, first word at lower address):
1 | 0 | 0 | 0 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
SUBCRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rd ← Ra - Rb - carry
-
carry ← ((Rb + carry) > Ra) ? 1 : 0
-
PC ← PC + 2
Encoding (format 10, first word at lower address):
1 | 0 | 0 | 0 | 0 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | i8 | i7 | i6 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
ANDIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
I ≤ 511
Outcome:
-
Rd ← Ra & I
-
PC ← PC + 2
Encoding (format 10, first word at lower address):
1 | 0 | 0 | 0 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | i2 | i1 | i0 |
0 | 0 | 0 | i8 | i7 | i6 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | i5 | i4 | i3 |
Syntax:
-
ORIRd,Ra,I
Constraints:
-
a ≤ 63
-
d ≤ 63
-
I ≤ 511
Outcome:
-
Rd ← Ra | I
-
PC ← PC + 2
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDBRd,(Ra,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← dmem[Ra + SignExt(S)]
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDWRd,(Ra,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← dmem [Ra + SignExt(S)] | (dmem[Ra + SignExt(S) + 1] << 8)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDBRd,(Ra+,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← dmem[Ra + SignExt(S)]
-
Ra ← Ra + SignExt(S)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDWRd,(Ra+,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← dmem [Ra + SignExt(S)] | (dmem[Ra + SignExt(S) + 1] << 8)
-
Ra ← Ra + SignExt(S)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDBRd,(-Ra,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Ra ← Ra - SignExt(S)
-
Rd ← dmem[Ra]
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 0 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
LDWRd,(-Ra,S)
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Ra ← Ra - SignExt(S)
-
Rd ← dmem [Ra] | (dmem[Ra + 1] << 8)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 1 | 0 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STB (Rd,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
0 | 0 | 1 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STW (Rd,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
dmem[Rd + SignExt(S) + 1] ← (Ra >> 8)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 1 | 0 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STB (Rd+,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
Rd ← Rd + SignExt(S)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STW (Rd+,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
dmem[Rd + SignExt(S)] ← (Ra & 255)
-
dmem[Rd + SignExt(S) + 1] ← (Ra >> 8)
-
Rd ← Rd + SignExt(S)
-
PC ← PC + 2
Notes:
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STB (-Rd,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← Rd - SignExt(S)
-
dmem[Rd] ← (Ra & 255)
-
PC ← PC + 2
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
Encoding (format 13, first word at lower address):
1 | 0 | 1 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | s2 | s1 | s0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | d5 | d4 | d3 | a5 | a4 | a3 | s5 | s4 | s3 |
Syntax:
-
STW (-Rd,S),Ra
Constraints:
-
d ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
Rd ← Rd - SignExt(S)
-
dmem[Rd] ← (Ra & 255)
-
dmem[Rd + 1] ← (Ra >> 8)
-
PC ← PC + 2
Notes:
-
For the avoidance of doubt, the decrement of Ra is carried out before Ra is used to compute the address for loading.
-
This opcode accesses data memory, and the computed address is therefore a byte address. Accessing a non-existent memory location will trigger a bus error exception.
![]() | Note |
|---|---|
|
As with the 16-bit instructions, only a limited range of comparisons is provided. See Section 3.6 for an explanation. |
Encoding (format 17, first word at lower address):
1 | 1 | 0 | 0 | 0 | 0 | 0 | s8 | s7 | s6 | s5 | s4 | s3 | s2 | s1 | s0 |
0 | 0 | 0 | s21 | s20 | s19 | s18 | s17 | s16 | s15 | s14 | s13 | s12 | s11 | s10 | s9 |
Syntax:
-
BRAS
Constraints:
-
-2,097,152 ≤ S ≤ 2,097,151
Outcome:
-
PC ← PC + SignExt(S)
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 16, first word at lower address):
1 | 1 | 0 | 0 | 0 | 0 | 1 | s5 | s4 | s3 | s2 | s1 | s0 | b2 | b1 | b0 |
0 | 0 | 0 | s18 | s17 | s16 | s15 | s14 | s13 | s12 | s11 | s10 | s9 | b5 | b4 | b3 |
Syntax:
-
BALS,Rb
Constraints:
-
b ≤ 63
-
-262,144 ≤ S ≤ 262,141
Outcome:
-
Rb ← PC + 2
-
PC ← PC + SignExt(S)
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 0 | 1 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BEQS,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra = Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 0 | 1 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BNES,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra ≠ Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 1 | 0 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BLTSS,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra < Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 1 | 0 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BLESS,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra ≤ Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 1 | 1 | 0 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BLTUS,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra < Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 12, first word at lower address):
1 | 1 | 0 | 0 | 1 | 1 | 1 | s2 | s1 | s0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | s9 | s8 | s7 | s6 | s5 | s4 | s3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
BLEUS,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
-512 ≤ S ≤ 511
Outcome:
-
PC ← (Ra ≤ Rb) ? PC + SignExt(S) : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the offset is the number of words by which to adjust the PC.
-
Branching to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
Syntax:
-
JMPRd
Constraints:
-
d ≤ 63
Outcome:
-
PC ← Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
Syntax:
-
JALRd,Rb
Constraints:
-
b ≤ 63
-
d ≤ 63
Outcome:
-
Rb ← PC + 2
-
PC ← Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JEQRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra = Rb) ? Rd : PC + 2
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JNERd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra ≠ Rb) ? Rd : PC + 2
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLTSRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra < Rb) ? Rd : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLESRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra ≤ Rb) ? Rd : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLTURd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra < Rb) ? Rd : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLEURd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 63
Outcome:
-
PC ← (Ra ≤ Rb) ? Rd : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
Syntax:
-
JMPLRd
Constraints:
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Rd+1 << 16) | Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
Syntax:
-
JALLRd,Rb
Constraints:
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
Rb ← PC + 2
-
PC ← (Rd+1 << 16) | Rd
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jumping to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JEQLRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra = Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 0 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JNELRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra ≠ Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 0 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLTSLRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra < Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 0 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLESLRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra ≤ Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
The comparison between Ra and Rb is a signed comparison, where the contents of each register is treated as a 2's-complement signed number.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 1 | 0 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLTULRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra < Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
Encoding (format 8, first word at lower address):
1 | 1 | 0 | 1 | 1 | 1 | 1 | d2 | d1 | d0 | a2 | a1 | a0 | b2 | b1 | b0 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | d5 | d4 | d3 | a5 | a4 | a3 | b5 | b4 | b3 |
Syntax:
-
JLEULRd,Ra,Rb
Constraints:
-
a ≤ 63
-
b ≤ 63
-
d ≤ 62
-
(d % 2) = 2
Outcome:
-
PC ← (Ra ≤ Rb) ? ((Rd+1 << 16) | Rd) : PC + 2
Notes:
-
The comparison between Ra and Rb is an unsigned comparison.
-
Remember that the program counter is a word address, so the value in Rd should be a word address.
-
Jump to a non-existent location will trigger a bus error exception.
![[Note]](http://www.embecosm.com/appnotes/ean13/images/note.png)