EMMA 02

PSEUDO CODE

  • Home
  • Download
  • Change Log
  • Help
  • Compilation
    • Windows
    • OS X
    • Ubuntu
    • Fedora
    • openSUSE
  • Forums
  • Tape Conversion
  • Machine Code
    • SYSTEM00
    • CDP1801
    • CDP1802
    • CDP1804
    • CDP1805
    • Differences
  • Pseudo Code
    • AMVBAS
    • AM4KBAS
    • CARDTRAN
    • Chip-8, 8X, ETI-660 & Elf
    • FEL-1
    • FPA-1
    • FPL-2
    • FPL-4
    • GPL-2
    • GPL-3
    • GPL-4
    • GPL-A (2K RAM)
    • GPL-A (2K ROM)
    • ST2
    • ST4
    • STK
    • Test-Word
    • Super-chip
  • XML Code
    • Main Elements
    • I/O
    • System
    • A/D Convertor
    • BASIC
    • Batch wav
    • Bootstrap
    • Cassette
    • CD4536B
    • CDP1851
    • CDP1852
    • CDP1854
    • CDP1855
    • CDP1877
    • CDP1878
    • CDP1879
    • Debugger
    • COMX Diagnostic
    • Dip switch
    • Disk
    • EF Buttons
    • Flip Flop
    • Front Panel
    • GUI
    • HEX Modem
    • I/O Group
    • Keyboard
    • Keyfile
    • Locations
    • Memory
    • MM57109
    • Printer
    • RTC
    • Sound
    • Splash
    • USB
    • Video
    • Videodump
    • vt
    • X Modem
  • BASIC
    • General Information
    • COMX BASIC V1.00
    • Floating Point BASIC 2.2
    • Pecom 32 BASIC
    • Pecom 64 BASIC 1.0 & 4.0
    • Quest Super BASIC 1.4
    • Quest Super BASIC 3.0
    • Quest Super BASIC 5.0
    • Quest Super BASIC 6.0
    • RCA BASIC3 V1.1
    • Telmac SBASIC v24.3
    • Error Messages
  • Computer List

 

 

 

 

 

 

 

 

 

 

 

 

FPL-2

Information

I expect FPL-2 stands for Fred Programming Language, version 2.

FPL-2 is used in the game 'Curses Foiled Again' running on the FRED 2 machine.

V0-F are stored on memory locations 0690-06AF.

Definitions

. 4 bit value but not used
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)
z Register number Vz (y = 0 to F)
[6aa] Memory value of address aa within page 6 (RAM)
F= Tone frequency
. Not used, value doesn't matter
1..9, A..F Hexadecimal digits

Syntax

Opcode Mnemonic Parameter Definition
6xyx ADD Vx, Vy Vx = Vx + Vy, V0 = carry
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 E000 (which is the 'FPL-2' equivalent of RETURN)
E010 CLS Clear display
Axkk DRW Vx, kk Draw 8*8 graphics:
Draw on screen location kk (i.e. memory address 7kk). Pattern location will be fetched from memory [6aa] (and onwards) where aa is stored on 06[Vx|0x80].
Bxyn DRW Vx, Vy, n Draw 8*8 graphics:
Draw on screen location Vy (i.e. memory address 7aa, where aa is stored in Vy). Pattern location will be fetched from [naa] (and onwards) where aa is stored in Vx.
Cxy0 DRW0 VF, Vx, Vy Draw 8*16 graphics and 'OR' bit pattern with what is already shown on screen:
Draw on screen position [Vx-1]+Vy, i.e. 7aa where aa = Vx-1 + Vy. Pattern location will be fetched from [6aa] (and onwards) where aa is stored in VF.
Cxy1 DRW1 Vx, Vy Draw 16*24 graphics:
Draw on screen location Vx (i.e. memory address 7aa, where aa is stored in Vx). Pattern location will be fetched from [5aa] (and onwards) where aa is stored on [6bb] where bb = 0x50 + highest nibble Vy.
Cxy2 DRW2 Vx, Vy Draw 16*24 graphics:
Draw on screen location Vx (i.e. memory address 7aa, where aa is stored in Vx). Pattern location will be fetched from [5aa] (and onwards) where aa is stored on [6bb] where bb = 0x54 + highest nibble Vy.
Cxy4 DRW4 VE, Vx, Vy Draw 8*16 graphics and 'OR' bit pattern with what is already shown on screen:
Draw on screen position [Vx+2]+Vy, i.e. 7aa where aa = Vx+2 + Vy. Pattern location will be fetched from [6aa] (and onwards) where aa is stored in VE.
E.08 KEY OFF Switch hex keypad off
Ex.1 KEY Vx Check if key is pressed if so return key value in Vx otherwise Vx is not changed
Faaa JP aaa Jump to address aaa
9xy. LD B, Vy, Vx Store BCD value of Vx in Vy, Vy+1 and Vy+2, Vy will point to last byte of the converted number
4xkk LD Vx, kk Vx = kk
6xyz LD Vz, Vx+Vy Same as ADD: Vz = Vx + Vy, V0 = carry
7xyz LD Vz, Vx-Vy Same as SUB: Vz = Vx - Vy, V0 = carry
5xaa LD LD [6aa], Vx
LD 6aa, vx
Memory Location [6aa] = Vx
E000 RETURN Return from subroutine
8xkk RND Vx, kk Vx = random AND kk
2xkk SNE Vx, kk Skip next instruction if Vx != kk
3nkk SNE n, kk Skip next instruction if kk != memory location [6En]
7xyz SUB Vz, Vx-Vy Vz = Vx - Vy, V0 = carry
7xyx SUB Vx, Vy Vx = Vx - Vy, V0 = carry
0aaa SYS aaa Call CDP1801 code at aaa. The subroutine must end in a RET (D4)
E.04 VIDEO OFF Video display disabled
E.02 VIDEO ON Video display enabled