Movatterモバイル変換


[0]ホーム

URL:


Pan Docs

    CPU Comparison with Z80

    Comparison with 8080

    The Game Boy CPU has a bit more in common with an older Intel 8080 CPUthan the more powerful Zilog Z80 CPU. It is missing a handful of 8080instructions but does support JR and almost all CB-prefixedinstructions. Also, all known Game Boy assemblers use the more obviousZ80-style syntax, rather than the chaotic 8080-style syntax.

    Unlike the 8080 and Z80, the Game Boy has no dedicated I/O bus and noIN/OUT opcodes. Instead, I/O ports are accessed directly by normal LDinstructions, or by new LD (FF00+n) opcodes.

    The sign and parity/overflow flags have been removed, as have the 12RET, CALL, and JP instructions conditioned on them. So have EX (SP),HL(XTHL) and EX DE,HL (XCHG).

    Comparison with Z80

    In addition to the removed 8080 instructions, the other exchangeinstructions have been removed (including total absence of secondregister set).

    All DD- and FD-prefixed instructions are missing. That means no IX- orIY-registers.

    All ED-prefixed instructions are missing. That means 16-bit memoryaccesses are mostly missing, 16-bit arithmetic functions are heavilycut-down, and some other missing instructions. IN/OUT (C) are replaced withnew LD ($FF00+C) opcodes. Block instructions are gone, but autoincrementingHL accesses are added.

    The Game Boy operates approximately as fast as a 4 MHz Z80 (8 MHz in CGBdouble speed mode), with execution time of all instructions having beenrounded up to a multiple of 4 cycles.

    Moved, Removed, and Added Opcodes

    OpcodeZ80GB CPU
    08EX AF,AFLD (nn),SP
    10DJNZ PC+ddSTOP
    22LD (nn),HLLDI (HL),A
    2ALD HL,(nn)LDI A,(HL)
    32LD (nn),ALDD (HL),A
    3ALD A,(nn)LDD A,(HL)
    D3OUT (n),A-
    D9EXXRETI
    DBIN A,(n)-
    DD<IX> prefix-
    E0RET POLD (FF00+n),A
    E2JP PO,nnLD (FF00+C),A
    E3EX (SP),HL-
    E4CALL P0,nn-
    E8RET PEADD SP,dd
    EAJP PE,nnLD (nn),A
    EBEX DE,HL-
    ECCALL PE,nn-
    ED<prefix>-
    F0RET PLD A,(FF00+n)
    F2JP P,nnLD A,(FF00+C)
    F4CALL P,nn-
    F8RET MLD HL,SP+dd
    FAJP M,nnLD A,(nn)
    FCCALL M,nn-
    FD<IY> prefix-
    CB 3XSLL r/(HL)SWAP r/(HL)

    Note: The unused (-) opcodes will lock up the Game Boy CPU when used.


    [8]ページ先頭

    ©2009-2026 Movatter.jp