FEL-1 Syntax

Information

FEL-1 = Fred II Experimental Language, version 1.

The FEL-1 Pseudo command syntax described here is used in the 'Fred demo' running on the FRED 1.5.

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

Definitions

aaa 12 bit address
kk 8 bit constant
l 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
1aaa CALL aaa Call subroutine at aaa. The subroutine must end in 026E (which is the 'FEL-1' equivalent of RETURN)
0078 CLS Clear display
7x4B DELAY Vx Vx Delay (Tape On, Speaker off)
9xyl DRW Vx, Vy, l Draw pattern, x = pattern address in page 3, y = tv cell address, l number of lines
7F6F INCA RA = RA + 1
Ex8D INP6 Vx Vx = INP 6
Faaa JP aaa Jump to address aaa
0268 KEY OFF Switch hex keypad off
Ex7A KEY Vx Wait for key press and return in Vx
7x52 LD B, [RA], Vx
B, [A], Vx
Convert Vx to 3 digit decimal at A, A+1, A+2
Aaaa LD RA, aaa
A, aaa
RA = aaa
Baaa LD RB, aaa
B, aaa
RB = aaa
7x2A LD RA.0, Vx
A.0, Vx
RA.0 = Vx
7x30 LD RA.1, Vx
A.1, Vx
RA.1 = Vx
7x34 LD RB.0, Vx
B.0, Vx
RB.0 = Vx
2xkk LD Vx, kk Vx = kk
7x38 LD Vx, RA.0
Vx, A.0
Vx = RA.0
7x3B LD Vx, RA.1
Vx, A.1
Vx = RA.1
7x1E LD Vx, [RA]
Vx, [A]
Vx = [RA]
7x21 LD Vx, [RB]
Vx, [B]
Vx = [RB]
7x24 LD [RA], Vx
[A], Vx
[RA] = Vx
7x27 LD [RB], Vx
[B], Vx
[RB] = Vx
8xy1 OR Vx, Vy Vx = Vx OR Vy
Ex91 OUT4 Vx OUT 4 with Vx
Ex8F OUT6 Vx OUT 6 with Vx
022F PUSH Push V0-VF, A, B to 01E0-EF, F0-F3
026E RETURN Return from subroutine CALL
4xkk RND Vx, kk Vx = random AND kk
8xy6 SHR Vx, Vy Vx = Vy SHR, V0 is carry / not borrow
7x3E SHL4 Vx Vx = Vx SHL 4
7x41 SHR4 Vx Vx = Vx SHR 4
E.8A SK3 Skip next instruction if EF3 = 1
Ex80 SKP Vx Read key if available if not skip next instruction
E.87 SKT Skip next instruction if tape is stopped
3xkk SNE Vx, kk Skip next instruction if Vx != kk
Cxy0 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)
6.kk TAPE kk Tape Controller - kk = code to write
E.93 TAPE READ Read tape to [RA] and onwards
E.A0 TAPE WRITE Write to tape from [RA] to 06FF
Dxy0 TONE Vx, Vy Vx Tone, Vy Delay (Tape on speaker off)
025C VIDEO ON Video display enabled
0240 VIDEO OFF Video display disabled
8xy3 XOR Vx, Vy Vx = Vx XOR Vy