First of all, I'd like to say this is a hardware-level question, which is very closely related to the "in" and "out" command in x86 assembly.
I have searched for quite some time, but I still haven't found how they send the addresses and the data. Does the 8086 first send the address, then the data? If so, how does the receiver know if the 8086 is sending a 16-bit address or an 8-bit address?
Aside from that, I'd also like to learn how the 8255 works, and how it accepts specific ports such as "port 60H".
Thanks for reading! 😀
Best Answer
As you mentioned 8086 processor i'm explaining with reference to 8086:
8086 is 16-bit processor(16-bit Data Bus means: no.of Physical lines to carry-out or carry-in are 16 lines some time ALU size also) and 20-bit Address Bus(20-bit Address Bus means : no.of Physical lines to carry-out the address are 20) these lines are nothing but 8086-pins.
To save No.of 8086 pins 16-data bus lines and 16- Address lines are multiplexed(during first part of Machine cycle 16-lines acts as Address bus later they acts as DATA Bus line) so pin count will be reduced.
Now your main Question Answer: Case:1(8086 wants to access a Byte in a Memory) 8086 can address 2^20(Address Bus size) Locations, each location holds a Byte(8-bits of data) that implies (2^10 x 2^10 =1024(1K) x1024(1K)=>1M) finally it ought to be 1MByte
Memory: Like USB Drive(2GB, 4GB,etc.) Each memory location has an Address and Location holds a byte(8-bits) suppose 1MB memory Chip will have 1024K Memory locations and each location has 8-bits data unit capacity
If 8086 Processor wants access a byte at an address first it'll send Address to to 1MB memory chip let say(0x20002) Location, this 1MB memory chip is connected to the 8086 Address bus and data bus. it's like below
There is another case if the memory is stack of memory chips like two 512KB chips of total 1MB(512KB + 512KB) In this case each memory chip has 19 address lines(512K = 512 x 1024 =>2^9 x 2^10) and one Important line called CHIP SELECT which enables the memory Chip Both Memory chip address line are connected to 8086 address bus But 8086 has 20 address lines so one line is used to connect Chip Select line of 512K Memory Chip which Enables the 512KB chip Here 1 address line has two states:0 or 1
Another case if memory size of 256 Bytes capacity(2^8), It has 8-ADDRESS LINES and a Chip Select Line
In the above case just 8 address line of 8086 are connected to the 256 Bytes Memory Chip but reaming are connected to the Chip select line of memory chip it maybe NOR gate whose output is one if all the inputs are zero
here let say 20 address lines(A19-A0) of 8086
In this way Processor access data from Memory Chip with the help of address and Data Bus
Case:2(some device may wants send data to 8086) It's very complex to explain here but soon i'll add to this question
finally about 8255 please refer this intel 8255 Wiki Page