Super-chip Syntax

Information

The Super-chip interpreter for the modified VIP (chip10 modification) and Studio IV was designed by me. It should support Super-CHIP 1.1, 00FA instruction from chip8run and also somewhat follows SCHIP/SCHPC however with some selectable options/quirks:

  1. SHIFT: When selected Vy will be ignored for SHL/SHR Vx, Vy instructions
  2. LOAD: When selected I will NOT be incremented for LD VX,[I] and LD [i], Vx
  3. BXNN: When selected JP B,aaa will jump to address xaa + V0 instead of aaa + V0
  4. VBLNK: When selected interpreter will wait for VBLaNK before drawing a sprite
  5. CLIPS: When selected Sprites will be CLIPed at top/bottom of screen

Note depending on keypad mapping 4 and 5 might be mapped to PC keys Q and W. To start the chip8 or Super-chip game press any key other than 1 to 5.

For chip8 games use: SHIFT, LOAD, BXNN not selected, VBLNK, CLIPS selected
For most Super-chip games use: SHIFT, LOAD, BXNN selected, VBLNK, CLIPS not selected

Some Super-chip games need the following setting:

Super-chip code should be located from 800-17FF. Note that address 800 is seen as 200 by the interpreter. So a command 2200 will do a call to address 800 instead of 200. Video memory is located from 1C00 to 1FFF and Vx-Vy are stored from 1BF0 to 1BFF.

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
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

Syntax

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
00FA COMP Set compatibility mode for FX55 and FX65; running this changes the behaviour of those instructions so they no longer change I
Dxyn DRW Vx, Vy, n Draw n byte sprite stored at [I] at Vx, Vy. Set VF = collision
If n=0 a 16x16 sprite is drawn in high res mode and a 8x16 sprite in low res mode
00FF HIGH High-resolution mode
1aaa JP aaa Jump to address aaa
Baaa JP V0, aaa BXNN option NOT selected:
Jump to address aaa + V0
BXNN option selected:
Jump to address xaa + V0
Fx33 LD B, Vx Store BCD value of Vx in [I], [I+1], [I+2]
Fx15 LD DT, Vx Delay timer = Vx
Fx29 LD F1, Vx Point I to 5 byte numeric sprite for value in Vx
Fx29 LD F2, Vx Point I to 10 byte numeric sprite for value in Vx
Aaaa LD I, aaa I = aaa
Fx18 LD ST, Vx Soundtimer = Vx
Fx07 LD Vx, DT Vx = Delay timer
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]
LOAD option NOT selected:
register I will be incremented
LOAD option selected:
register I will not be incremented
Fx55 LD [I], Vx Store V0 .. Vx in [I] .. [I+x]
LOAD option NOT selected:
register I will be incremented
LOAD option selected:
register I will not be incremented
00FE LOW Low-resolution mode
00FD NOP No operation, for backward compatibility to the Super-Chip 1.0 Exit interpreter command
8xy1 OR Vx, Vy Vx = Vx OR Vy, VF undefined
Fx85 READ Read V0..VX from RPL user flags (X <= 7), RPL is stored on 1BE0-1BE7
00EE RETURN Return from subroutine (16 levels)
Cxkk RND Vx , kk Vx = random AND kk
00CN SCD Scroll display N pixels down; in low resolution mode, N/2 pixels
00FC SCL Scroll left by 4 pixels; in low resolution mode, 2 pixels
00FB SCR Scroll right by 4 pixels; in low resolution mode, 2 pixels
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 SHIFT option NOT selected:
Vx = Vy << 1, VF = carry
SHIFT option selected:
Vx = Vx << 1, VF = carry
8xx6 SHR Vx Vx = Vx >> 1, VF = carry
8xy6 SHR Vx , Vy SHIFT option NOT selected:
Vx = Vy >> 1, VF = carry
SHIFT option selected:
Vx = Vx >> 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
Fx75 STORE Store V0..VX in RPL user flags (X <= 7), RPL is stored on 1BE0-1BE7
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