Z80 asm to hex guide

Discussion in 'Tutorials Archive' started by Ravenfreak, Nov 22, 2010.

Thread Status:
Not open for further replies.
  1. Ravenfreak

    Ravenfreak Still hacking the 8-bit titles Member

    Joined:
    Feb 10, 2010
    Messages:
    410
    Location:
    O'Fallon, MO
    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 might add the binary value of each instruction in the future. Note: not every instruction is documented yet, and some need to be edited.


    Hex z80 instruction description


    ---------------------------------------


    F3 di disable interrupts


    ED56 im interrupt mode (in this case 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 (obviously :V)


    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 or :V


    FD iy register iy


    21 z zero flag


    36 hl registers (ex: ld (hl),00h)


    FB ei enable interrupts


    D6 sub subtract


    FF rst restart


    D9 reti return from interrupt
     
Thread Status:
Not open for further replies.