179 líneas
1.6 KiB
Plaintext
179 líneas
1.6 KiB
Plaintext
|
-- List of Opcodes Sorted by Function --
|
||
|
|
||
|
--- Registers ---
|
||
|
|
||
|
0: B
|
||
|
1: C
|
||
|
2: D
|
||
|
3: E
|
||
|
4: H
|
||
|
5: L
|
||
|
6: (HL)
|
||
|
7: A
|
||
|
|
||
|
--- Control Codes ---
|
||
|
|
||
|
'UNCOND: No condition
|
||
|
0: NZ
|
||
|
1: Z
|
||
|
2: NC
|
||
|
3: C
|
||
|
|
||
|
--- Racket Implementation ---
|
||
|
|
||
|
'(NOP)
|
||
|
'(STOP)
|
||
|
'(RLCA)
|
||
|
'(RRCA)
|
||
|
'(RLA)
|
||
|
'(RRA)
|
||
|
'(DAA)
|
||
|
'(CPL)
|
||
|
'(SCF)
|
||
|
'(CCF)
|
||
|
'(EI)
|
||
|
'(DI)
|
||
|
|
||
|
'(Prefix)
|
||
|
'(Removed)
|
||
|
|
||
|
'(RST #x10)
|
||
|
|
||
|
'(16b-ld-regp-imm 3 #xFFE0) ; uses lookup table for regp
|
||
|
|
||
|
--- Misc ---
|
||
|
|
||
|
NOP
|
||
|
STOP
|
||
|
RLCA
|
||
|
RRCA
|
||
|
RLA
|
||
|
RRA
|
||
|
DAA
|
||
|
CPL
|
||
|
SCF
|
||
|
CCF
|
||
|
EI
|
||
|
DI
|
||
|
CB-Prefix
|
||
|
Removed
|
||
|
|
||
|
rst-vec:
|
||
|
RST $0000
|
||
|
|
||
|
--- LDs ---
|
||
|
16b-ld-indimm-regp:
|
||
|
LD ($XXYY), SP
|
||
|
|
||
|
16b-ld-regp-imm:
|
||
|
LD BC, $XXYY
|
||
|
|
||
|
8b-ld-indregp-a:
|
||
|
LD (BC), A
|
||
|
8b-ld-a-indregp:
|
||
|
LD A, (BC)
|
||
|
|
||
|
8b-ldi-a-indregp:
|
||
|
LD A, (HL+)
|
||
|
8b-ldi-indregp-a:
|
||
|
8b-ldd-a-indregp:
|
||
|
8b-ldd-indregp-a:
|
||
|
|
||
|
8b-ld-reg-imm:
|
||
|
|
||
|
8b-ld-reg-reg:
|
||
|
|
||
|
8b-ldh-imm-a:
|
||
|
8b-ldh-a-imm:
|
||
|
16b-ld-HL-SP+d:
|
||
|
16b-ld-SP-HL:
|
||
|
|
||
|
8b-ldh-c-a:
|
||
|
8b-ldh-a-c:
|
||
|
8b-ld-indimm-a:
|
||
|
8b-ld-a-indimm:
|
||
|
|
||
|
--- ALU ---
|
||
|
|
||
|
8b-and-imm:
|
||
|
8b-adc-imm:
|
||
|
8b-sub-imm:
|
||
|
8b-sbc-imm:
|
||
|
8b-and-imm:
|
||
|
8b-xor-imm:
|
||
|
8b-or-imm:
|
||
|
8b-cp-imm:
|
||
|
|
||
|
8b-add-a-reg:
|
||
|
8b-adc-a-reg:
|
||
|
8b-sub-a-reg:
|
||
|
8b-sbc-a-reg:
|
||
|
|
||
|
8b-and-reg:
|
||
|
8b-xor-reg:
|
||
|
8b-or-reg:
|
||
|
8b-cp-reg:
|
||
|
|
||
|
8b-inc:
|
||
|
|
||
|
8b-dec:
|
||
|
|
||
|
16b-inc:
|
||
|
|
||
|
16b-dec:
|
||
|
|
||
|
16b-add-regp-regp:
|
||
|
ADD HL, BC (HL only)
|
||
|
|
||
|
--- Jumps ---
|
||
|
jp-relative:
|
||
|
JR [uncond], $d
|
||
|
JR NZ, $d
|
||
|
JR Z, $d
|
||
|
JR NC, $d
|
||
|
JR C, $d
|
||
|
|
||
|
ret:
|
||
|
RET (uncond)
|
||
|
RET NZ
|
||
|
RET Z
|
||
|
RET NC
|
||
|
RET C
|
||
|
|
||
|
reti:
|
||
|
RETI
|
||
|
|
||
|
jp-regp:
|
||
|
JP HL
|
||
|
|
||
|
jp-imm:
|
||
|
JP (uncond), $XXYY
|
||
|
JP NZ, $XXYY
|
||
|
|
||
|
call-imm:
|
||
|
CALL (uncond), $XXYY
|
||
|
CALL NZ, $XXYY
|
||
|
|
||
|
--- Stack ---
|
||
|
|
||
|
16b-pop:
|
||
|
POP BC
|
||
|
|
||
|
16b-push:
|
||
|
PUSH BC
|
||
|
|
||
|
--- CB Prefix ---
|
||
|
|
||
|
8b-rlc-reg:
|
||
|
8b-rrc-reg:
|
||
|
8b-rl-reg:
|
||
|
8b-rr-reg:
|
||
|
8b-sla-reg:
|
||
|
8b-sra-reg:
|
||
|
8b-swap-reg:
|
||
|
8b-srl-reg:
|
||
|
|
||
|
8b-bit-x-reg:
|
||
|
8b-res-x-reg:
|
||
|
8b-set-x-reg:
|