I understood but as B doesn't change anything, so I also tried with different values in R before the instruction and even in the next byte but, there was no difference I always get IN B,(C) not IN B,(BC).
Does it only work if there are connections to a device?
Because I think on MSX B (A8-15) is not connected or not used.
A8-A15 is connected on MSX (they come straight out of the Z80), however no MSX hardware that I know of makes use of the 16 bit I/O currently. Hardware which only decodes A0-A7 ignore the value in B and are mirrored 256 times.
However it is explicitly possible, and can be a solution for the limited free I/O space, since on each 8-bit I/O port there are 256 additional addressable ports up for grabs.
So this is why I said, if you want to be precise, there are 65536 I/O ports.
You mean 65536 input and output ports?
How many could have been mirrored?
If you are saying is true, can we also do like out (port),HL ?
That would be pretty time saving.
If you are saying is true, can we also do like out (port),HL ?
The address bus is 16 bits, the data bus is 8 bits, so in principle no. I guess you could interpret the address A8-A15 value as data (for output only, as the address bus is unidirectional), that would be a bit weird / unexpected though.
It would be like having 256 pools, selected by B, of 256 8-bit ports.
If the bus is 16 bit and data is 8 bit , thus out (port),HL can be converted internally first L than H sending...
That is what I would expect...
Port is 0 - 65535 and HL as well..
Ok, that is very clear, and logic, but I am not interested in unconnected ports, I am interested in connected ports that give a value of 08BH... If they are connected they are useable, regardless result..
In the image previously showed, and compared to OpenMSX, you see a difference in data in ports #41H, #43H, #44H, #45H, #46H.
Real Sony HB-F700D give result of 08B# and OpenMSX give #FFH..
And If you look at the image, more ports are like this...
If you go that far, then there are actually 65536 input and output ports, since I/O is really 16-bit
Is it supported by CMOs?
In fact, it's we have no 65536 I/O ports on MSX, and far from it, since the existing components/peripherals are only connected in 8 bits to the ports. It means that even if we connect a new one on 16 bits those which have the same 8 bits of weak point will react at the same time. At most, we can expand an unused port to 256.