cj7hawk
Veteran Member
I'm still trying to get my head around whether 0FE0AH was I/O in memory space, or whether the original objective was to use 0FE0AH as I/O space?
Aren't all ports I/O space? In which case,
LD BC,0FE0AH
IN A,(C)
OUT (C),A
Would load and output the accumulator to a 16 bit I/O port by placing BC on the address bus during an I/O cycle.
Port input could also be done by
LD A,0FEH
IN A,(00AH)
As the A register appears on A8-A15 during an I/O cycle.
Or was the 0FE0AH address literally a memory address being used as a defacto I/O address by the memory space decode? I didn't notice which he said, but language like Port usually makes me thing of I/O.
I know a lot of people don't consider the z80 to have 16 bit I/O address space, but I use it like that at times and while it's not 8080/8085 backwards compatible it works fine on the z80 and with z80 assemblers. Pretty much any old Spectrum programmers always think in 16 bits for I/O.
Aren't all ports I/O space? In which case,
LD BC,0FE0AH
IN A,(C)
OUT (C),A
Would load and output the accumulator to a 16 bit I/O port by placing BC on the address bus during an I/O cycle.
Port input could also be done by
LD A,0FEH
IN A,(00AH)
As the A register appears on A8-A15 during an I/O cycle.
Or was the 0FE0AH address literally a memory address being used as a defacto I/O address by the memory space decode? I didn't notice which he said, but language like Port usually makes me thing of I/O.
I know a lot of people don't consider the z80 to have 16 bit I/O address space, but I use it like that at times and while it's not 8080/8085 backwards compatible it works fine on the z80 and with z80 assemblers. Pretty much any old Spectrum programmers always think in 16 bits for I/O.