Skip to content

z80 IN and OUT instructions do not support the upper byte of the address #325

@abelykh0

Description

@abelykh0

z80 port address is 16 bit, not 8

I was testing Sinclair emulator and realized that BREAK in BASIC didn't work. My changes fix this.

Their code for BREAK is like this:

1F54 BREAK-KEY
LD A,+7F Form the port address
IN A,(+FE) +7FFE and read in a byte.
RRA Examine only bit 0 by shifting it into the carry position.
RET C Return if the BREAK key is not being pressed.
LD A,+FE Form the port address
IN A,(+FE) +FEFE and read in a byte.
RRA Again examine bit 0.
RET Return with carry reset if both keys are being pressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions