I am reading the manual, and it's a bit complex. I can't understand the machine code encoding for the life of me, but that's not my main concern ... my main concern is the address/data buses.
I do not understand the difference between the "address out" from the OUT instruction, and the port configuration as well, AND the involvement of the register data operands.
Quoted directly from the z80 manual:
The contents of register C are placed on the bottom half (A0 through A7) of the address bus to select the I/O device at one of 256 possible ports.
Question time:
1.What does "the bottom half" mean?
2.Where/what are the 256 possible ports, and how does it select one, and where does it go exactly from there?
Next quote:
If the contents of register C are 01H, and the contents of register D are 5AH, at execution of OUT (C),D byte 5AH is written to the peripheral device mapped to I/O port address 01H.
So if I have 1 in register C, and 90 in D, and I write OUT(C), D 90 is written to the something mapped to 1? How do I know what is mapped at 1?
PS: Also, if I have hardware at mapped address 1, where does 90 (the value represented) go to in that hardware?
Do not get me wrong by my confusion here, I am a programmer ... I just have very limited experience coding at this low-level, and just need some clarification.