This guide should be useful for those who want to hack SMS/GG ROMS in a hex editor. This also goes for GB ROMs for the most part, though some instructions and registers are missing from the GB Z80 instruction set that are part of the Zilog Z80 instruction set. I obviously didn't add the binary data for each offset, but if you'd like me to, I can add that. This list isn't complete yet, and some things need to be edited.
Hex z80 instruction description
------------------------------------------
F3 di disable interrupts
ED56 im interrupt mode (in this case 1, for the most part it seems all Sonic SMS games only use interrupt mode 1)
DB in increment data
3C inc
FE cp compare
FA jr jump relative
C3 jp jump
BF ld load
87 add add
3A a accumulator (3E while data is being stored here ex: ld (0bh),a)
CD call call subroutine
6E l register l
F5 push push data onto stack pointer note: 10 is decresed each time a value is pushed to the stack in hex, so the next value of data to be pushed onto the stack would be E5 and so on.
FD af accumulator/flag registers
31 sp stack pointer
00 nop no operation
44 b register b
65 h register h
EE xor extended or
CB iy register iy
D3 out output to port
DD ix register ix
E6 and
F0 bit bit set
F6 or
FD iy register iy
21 z zero flag
36 hl registers (only while registers are being stored at a offset. ex: ld (hl),00h)
FB ei enable interrupts
D6 sub subtract
FF rst restart
D9 reti return from interrupt
Hex z80 instruction description
------------------------------------------
F3 di disable interrupts
ED56 im interrupt mode (in this case 1, for the most part it seems all Sonic SMS games only use interrupt mode 1)
DB in increment data
3C inc
FE cp compare
FA jr jump relative
C3 jp jump
BF ld load
87 add add
3A a accumulator (3E while data is being stored here ex: ld (0bh),a)
CD call call subroutine
6E l register l
F5 push push data onto stack pointer note: 10 is decresed each time a value is pushed to the stack in hex, so the next value of data to be pushed onto the stack would be E5 and so on.
FD af accumulator/flag registers
31 sp stack pointer
00 nop no operation
44 b register b
65 h register h
EE xor extended or
CB iy register iy
D3 out output to port
DD ix register ix
E6 and
F0 bit bit set
F6 or
FD iy register iy
21 z zero flag
36 hl registers (only while registers are being stored at a offset. ex: ld (hl),00h)
FB ei enable interrupts
D6 sub subtract
FF rst restart
D9 reti return from interrupt
This post has been edited by Ravenfreak: 22 November 2010 - 05:30 PM


00