Oldland Instruction Set
Arithmetic/Bitwise instructions
Call/Branch/Exception instructions
Load/Store instructions
Miscellaneous instructions
add
Class: 0, Opcode: 0
Description
Rd := Ra + OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
addc
Class: 0, Opcode: 1
Description
Rd := Ra + OP2 + C, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
sub
Class: 0, Opcode: 2
Description
Rd := Ra - OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
subc
Class: 0, Opcode: 3
Description
Rd := Ra - OP2 + C, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
lsl
Class: 0, Opcode: 4
Description
Rd := Ra << OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
lsr
Class: 0, Opcode: 5
Description
Rd := Ra >> OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
and
Class: 0, Opcode: 6
Description
Rd := Ra & OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
xor
Class: 0, Opcode: 7
Description
Rd := Ra ^ OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
bic
Class: 0, Opcode: 8
Description
Rd := Ra &= ~(1 << OP2), OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
bst
Class: 0, Opcode: 9
Description
Rd := Ra |= (1 << OP2), OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
or
Class: 0, Opcode: 10
Description
Rd := Ra | OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
mul
Class: 0, Opcode: 11
Description
Rd := Ra * OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
cmp
Class: 0, Opcode: 12
Description
Ra - OP2, OP2 may either be a register or a 13-bit signed immediate. The result is discarded.
Instruction Operands
- ra
- imm13 or rb
asr
Class: 0, Opcode: 14
Description
Rd := Ra ASR OP2, OP2 may either be a register or a 13-bit signed immediate.
Instruction Operands
- rd
- ra
- imm13 or rb
mov
Class: 0, Opcode: 15
Description
Rd := OP1, OP1 may be either a register or a 13-bit signed immediate.
Instruction Operands
- rd
- imm13 or rb
call
Class: 1, Opcode: 0
Description
PC := PC + (I << 2) if immediate, PC := Rb if register. LR := PC + 4.
Instruction Operands
- imm24 or rb
ret
Class: 1, Opcode: 1
Description
PC := LR
b
Class: 1, Opcode: 4
Description
PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bne
Class: 1, Opcode: 5
Description
If !Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
beq
Class: 1, Opcode: 6
Description
If Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bgt
Class: 1, Opcode: 7
Description
If !C && !Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
blt
Class: 1, Opcode: 8
Description
If C && !Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bgts
Class: 1, Opcode: 9
Description
If !Z && (N == O) PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
blts
Class: 1, Opcode: 10
Description
If N != O PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bgte
Class: 1, Opcode: 12
Description
If !C PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bgtes
Class: 1, Opcode: 13
Description
If N == O PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
blte
Class: 1, Opcode: 14
Description
If C || Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
bltes
Class: 1, Opcode: 11
Description
If (N != O) || Z PC := PC + (i << 2) if immediate, PC := RB if register.
Instruction Operands
- imm24 or rb
ldr32
Class: 2, Opcode: 0
Description
Rd := M[PC + I] (32-bits) if immediate, M[Ra + I] if register.
Instruction Operands
- rd
- imm13pc or index
ldr16
Class: 2, Opcode: 1
Description
Rd := M[PC + I] (16-bits) if immediate, M[Ra + I] if register.
Instruction Operands
- rd
- imm13pc or index
ldr8
Class: 2, Opcode: 2
Description
Rd := M[PC + I] (8-bits) if immediate, M[Ra + I] if register.
Instruction Operands
- rd
- imm13pc or index
str32
Class: 2, Opcode: 4
Description
M[PC + I] := Rb (32-bits) if immediate, M[Ra + I] := Rb if register.
Instruction Operands
- rb
- imm13pc or index
str16
Class: 2, Opcode: 5
Description
M[PC + I] := Rb (16-bits) if immediate, M[Ra + I] := Rb if register.
Instruction Operands
- rb
- imm13pc or index
str8
Class: 2, Opcode: 6
Description
M[PC + I] := Rb (8-bits) if immediate, M[Ra + I] := Rb if register.
Instruction Operands
- rb
- imm13pc or index
bkp
Class: 3, Opcode: 0
Description
Hardware breakpoint.
nop
Class: 3, Opcode: 15
Description
No operation.
movhi
Class: 3, Opcode: 11
Description
Rd := imm16 << 16.
Instruction Operands
- rd
- imm16
orlo
Class: 3, Opcode: 13
Description
Rd := Rb | imm16.
Instruction Operands
- rd
- rb
- imm16
cpuid
Class: 3, Opcode: 7
Description
Rd := cpuid[imm16].
Instruction Operands
- rd
- imm13
gcr
Class: 2, Opcode: 9
Description
Rd := control register N.
Instruction Operands
- rd
- imm13
Privileged instruction.
scr
Class: 2, Opcode: 10
Description
Control register N := ra.
Instruction Operands
- imm13
- ra
Privileged instruction.
swi
Class: 1, Opcode: 15
Description
Raise SWI imm13.
Instruction Operands
- imm13
rfe
Class: 1, Opcode: 2
Description
Return from exception.
Privileged instruction.
cache
Class: 2, Opcode: 15
Description
Cache operation imm13, with index Ra if index valid.
Instruction Operands
- ra
- imm13
Privileged instruction.
gpsr
Class: 3, Opcode: 1
Description
Move the PSR into Rd.
Instruction Operands
- rd
spsr
Class: 3, Opcode: 2
Description
Move the contents of Ra into the PSR.
Instruction Operands
- ra