ST2 Syntax

This info is also available online on the Emma 02 site.

Definitions

aaa 12 bit address
kk 8 bit constant
n 4 bit constant
x Register number Vx (x = 0 to F)
y Register number Vy (y = 0 to F)
I Register I (12 bit)
[I] Memory value of address in register I
[Vy] Memory value of address in register Vy within in page 8 (RAM)
1..9, A..F Hexadecimal digits

Syntax

7xkk ADD Vx, kk Vx = Vx + kk, x != 0
8xy4 ADD Vx, Vy Vx = Vx + Vy, VB = carry
FxB6 AFOR Vx AND register Vx with F (15), then OR result into least significant byte of register I (used for looking up number graphics), x != 0
8xy2 AND Vx, Vy Vx = Vx AND Vy, VB undefined
2aaa CALL aaa Call subroutine at aaa (The maximum depth of subroutine call is defined by the 1802 Stack, which grows down into user memory from $880)
70kk DJNZ V0, kk Decrement V0, jump to kk (same page) if register V0 is not zero
Dnkk JKP n, kk Check if key number n is pressed, if so store key in RB and jump to kk (same page), n != F
DFkk JKP VB, kk Check if key number stored in RB from keypad in RA (1= left, 0 = right) is pressed, if jump to kk (same page)
1aaa JP aaa Jump to address aaa
3xkk JNZ Vx, kk Jump to kk (same page) if register Vx is not zero
4xkk JZ Vx, kk Jump to kk (same page) if register Vx is zero
9xy8 LD B, [Vy], Vx
B, Vy, Vx
Store BCD value of Vx in [Vy+800], [Vy+801], [Vy+802], MSB Vx unchanged, Vy will point to last byte of the converted number
Aaaa LD I, aaa I = aaa
6xkk LD Vx, kk Vx = kk
8xy0 LD Vx, Vy Vx = Vy, VB undefined
9xy2 LD Vx, [Vy] Vx = [Vy+800]
9xy1 LD Vy, Vx Vy = Vx, VB undefined
Bnkk LD [I], kk, n
[I], kk, +n
[I] = kk, I = I + n
9xy4 LD [Vy], Vx [Vy+800] = Vx
02F2 LD [>I], 0
[I], 0
If I contains $Axx fills memory locations $A00 to $Axx (inclusive) with zero.
FxA6 LDM Vx, [I] Vx = [I], x != 0
FxA9 LDM [I], Vx [I] = Vx, x != 0
FxAC LDMA Vx, [I] Vx = [I], I = I + 1, x != 0
FxAF LDMA [I], Vx [I] = Vx, I = I + 1, x != 0
8xy1 OR Vx, Vy Vx = Vx OR Vy, VB undefined
C0 RETURN Return from subroutine
Cxkk RND Vx , kk Vx = random AND kk, x != 0
FxB3 SLSB Vx Set least significant byte of I to Vx, bit 8 to 11 are unaffected, x != 0
8xxE SHL Vx Vx = Vx << 1, VB = carry
8xyE SHL Vx , Vy Vx = Vy << 1, VB = carry
8xx6 SHR Vx Vx = Vx >> 1, VB = carry
8xy6 SHR Vx , Vy Vx = Vy >> 1, VB = carry
5xkk SNE Vx, kk Skip next instruction if Vx != kk
9xy0 SNE Vx, Vy Skip next instruction if Vx != Vy
E0 SP CLEAR Clear sprite graphic buffer
E1 SP MOVE Move sprite
E2 SP VC, MOVE Move sprite in direction given in register RC
E4 SP XOR, [I] XOR graphic data at register I into sprite graphic buffer
E8kk SP DRW, JC, kk
DRW, kk
Draw sprite, jump to kk (same page) if a collision occurs
8xy5 SUB Vx, Vy Vx = Vx - Vy, VB = !borrow
8xy7 SUBN Vx, Vy Vx = Vy - Vx, VB = !borrow
0aaa SYS aaa Call CDP1802 code at aaa
F0kk SYS 2kk Call CDP1802 code at 2kk
0066 VIDEO ON Turns on the video circuitry. This is actually done in the boot sequence.
8xy3 XOR Vx, Vy Vx = Vx XOR Vy, VB undefined