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

 

 

 

 

 

 

 

 

 

 

 

 

Chip-8, 8X, ETI & Elf

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
NH Bit 0-3 Horizontal Location
Bit 4-7, Horizontal width
NV Bit 0-3 Vertical Location
Bit 4-7, Vertical height
1..9, A..F Hexadecimal digits

Chip-8 Syntax

Opcode Mnemonic Parameter Definition
Fx1E ADD I, Vx I = I + Vx
7xkk ADD Vx, kk Vx = Vx + kk
8xy4 ADD Vx, Vy Vx = Vx + Vy, VF = carry
8xy2 AND Vx, Vy Vx = Vx AND Vy, VF undefined
2aaa CALL aaa Call subroutine at aaa (16 levels)
00E0 CLS Clear display
Dxyn DRW Vx, Vy, n Draw n byte sprite stored at [I] at Vx, Vy. Set VF = collision
1aaa JP aaa Jump to address aaa
Baaa JP V0, aaa Jump to address aaa + V0
Fx33 LD B, Vx Store BCD value of Vx in [I], [I+1], [I+2]
Fx15 LD DT, Vx Delaytimer = Vx
Fx29 LD F, Vx Point I to 5 byte numeric sprite for value in Vx
Aaaa LD I, aaa I = aaa
Fx18 LD ST, Vx Soundtimer = Vx
Fx07 LD Vx, DT Vx = Delaytimer
Fx0A LD Vx, K Vx = key, wait for keypress
6xkk LD Vx, kk Vx = kk
8xy0 LD Vx, Vy Vx = Vy, VF undefined
Fx65 LD Vx, [I] Read V0 .. Vx from [I] .. [I+x]
Fx55 LD [I], Vx Store V0 .. Vx in [I] .. [I+x]
8xy1 OR Vx, Vy Vx = Vx OR Vy, VF undefined
00EE RETURN Return from subroutine (16 levels)
Cxkk RND Vx , kk Vx = random AND kk
3xkk SE Vx , kk Skip next instruction if Vx == kk
5xy0 SE Vx , Vy Skip next instruction if Vx == Vy
8xxE SHL Vx Vx = Vx << 1, VF = carry
8xyE SHL Vx , Vy Vx = Vy << 1, VF = carry
8xx6 SHR Vx Vx = Vx >> 1, VF = carry
8xy6 SHR Vx , Vy Vx = Vy >> 1, VF = carry
Ex9E SKP Vx Skip next instruction if key Vx down
ExA1 SKNP Vx Skip next instruction if key Vx up
4xkk SNE Vx, kk Skip next instruction if Vx != kk
9xy0 SNE Vx, Vy Skip next instruction if Vx != Vy
8xy5 SUB Vx, Vy Vx = Vx - Vy, VF = !borrow
8xy7 SUBN Vx, Vy Vx = Vy - Vx, VF = !borrow
0aaa SYS aaa Call CDP1802 code at aaa
8xy3 XOR Vx, Vy Vx = Vx XOR Vy, VF undefined

Chip-8X Syntax

All of the instruction from Chip-8, except 'Baaa: JP V0, aaa' are valid for Chip-8X. Chip-8X offers the following additional instructions:

Opcode Mnemonic Parameter Definition
5xy1 ADD8 Vx, Vy Vx = Vx + Vy (hex digits 00 to 77, mainly for manipulating the NH and NV parameters)
02A0 CLR B
BACK
Step background 1 colour (-> blue, -> black, -> green, -> red ->)
Bxy0 CLR
CLRL
Vx, Vy
Vx/Vz, Vy
Set Vy colour @ Vx (NH), Vz (Vz has to be V(x+1)) (NV)
Bxyn CLR
CLRH
Vx, Vy, n
Vx/Vz, Vy, n
Set Vy colour @ Vx, Vz (Vz has to be V(x+1)) byte, n bytes vertically, n != 0
FxFB INP1 Vx Input port 1 to Vx (waits for EF4=1)
FxF8 OUT3 Vx Vx to output port 3 (used for simple sound)
ExF2 SKP2 Vx Skip next instruction if key Vx on keypad 2 is down
ExF5 SKNP2 Vx Skip next instruction if key Vx on keypad 2 is up

ETI-660 Chip-8 Syntax

All of the instruction from Chip-8 are valid for the TI-660 Chip-8 variant. ETI-660 Chip-8 offers the following additional instruction:

Opcode Mnemonic Parameter Definition
0000 EXIT Return to Monitor
00F8 TVON Turn the screen on
00FC TVOFF Turn the screen off
00FF NOP Do nothing
Fx00 LD P, Vx Set the pitch (frequency) of the tone generator (beeper) to Vx

Elf Chip-8 Syntax

All of the instruction from Chip-8 are valid for the Elf Chip-8 variant and also offers the following additional instruction:

Opcode Mnemonic Parameter Definition
Fx75 OUT4 Vx OUT 4 with Vx