GPL-4 Syntax

Information

I expect GPL-4 stands for Game Programming Language, version 4.

GPL-4 is used in the game 'Coin Bowling' running on the RCA Video Coin Arcade machine.

V0-F are stored on memory locations 0880-088F.

Note: E... is not defined.

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

Definitions

aaa 12 bit address
kk 8 bit constant
d 4 bit constant
n 4 bit constant
x Register number Vx (x = 0 to F)
y Register number Vy (y = 0 to F)
z Register number Vz (y = 0 to F)
[8aa] Memory value of address aa within page 8 (RAM)
[Vy] Memory value of address in register Vy within in page 8 (RAM)
F= Tone frequency
. Not used, value doesn't matter
1..9, A..F Hexadecimal digits

Syntax

5xkk ADD Vx, kk Vx = Vx + kk
8xy4 ADD Vx, Vy Vx = Vx + Vy, V0 is carry / not borrow
8xy2 AND Vx, Vy Vx = Vx AND Vy
Ddkk BEEP F=kk, d
kk, d
Beep with a frequency kk and duration d
1aaa CALL aaa Call subroutine at aaa. The subroutine must end in 0100 (which is the 'GPL-4' equivalent of RETURN)
C.54 DECB RB = RB - 1
9xln DRW Vx, l, n Draw pattern, [RA] = pattern address in page 3, Vx = tv cell address, l = number of lines, n = number of graphics
C.50 INCA RA = RA + 1
C.51 INCB RB = RB + 1
Faaa JP aaa Jump to address aaa
Cx05 LD BP, RA, Vx Store BCD Pattern value of Vx in RA, RA+1 and RA+2
Aaaa LD RA, aaa
A, aaa
RA = aaa
Baaa LD RB, aaa
B, aaa
RB = aaa
Cx4D LD RA.0, Vx
A.0, Vx
RA.0 = Vx
Cx41 LD RB.0, Vx
B.0, Vx
RB.0 = Vx
Cx44 LD RB.1, Vx
B.1, Vx
RB.1 = Vx
6x5D LD Vx, COIN Load status coin detector to Vx, no coin Vx = 1, coin Vx = 0
6x63 LD Vx, FIREA Load status fire key player A to Vx, no fire pressed Vx = 1, fire pressed Vx = 0
6x67 LD Vx, FIREB Load status fire key player B to Vx, no fire pressed Vx = 1, fire pressed Vx = 0
6x6B LD Vx, JOYA Load status joystick keys player A to Vx
6x74 LD Vx, JOYB Load status joystick keys player B to Vx
2xkk LD Vk, kk Vx = kk
6x7B LD Vx, PAR Load input parameter switch to Vx
Cx56 LD Vx, RA.0
Vx, A.0
Vx = RA.0
Cx47 LD Vx, RB.0
Vx, B.0
Vx = RB.0
Cx4A LD Vx, RB.1
Vx, B.1
Vx = RB.1
Cx35 LD Vx, [RA]
Vx, [A]
Vx = [RA], RA = RA + 1
Cx38 LD Vx, [RB]
Vx, [B]
Vx = [RB], RB = RB + 1
4xy1 LD Vy, Vx Vy = Vx
Cx3B LD [RA], Vx
[A], Vx
[RA] = Vx, RA = RA + 1
Cx3E LD [RB], Vx
[B], Vx
[RB] = Vx, RB = RB + 1
8xy1 OR Vx, Vy Vx = Vx OR Vy
0100 RETURN Return from subroutine
7xkk RND Vx, kk Vx = random AND kk
8xy6 SHR Vx, Vy Vx = Vy SHR, V0 is carry / not borrow
3xkk SNE Vx, kk Skip next instruction if Vx != kk
4xy0 SNE Vx, Vy Skip next instruction if Vx != Vy
8xy5 SUB Vx, Vy Vx = Vx - Vy, V0 is carry / not borrow
8xy7 SUBN Vx, Vy Vx = Vy - Vx, V0 is carry / not borrow
0aaa SYS aaa Call CDP1801 code at aaa. The subroutine must end in a RET (D4)
8xy3 XOR Vx, Vy Vx = Vx XOR Vy