I/O ports are quite messy... (Detect OpenMSX)

Page 4/5
1 | 2 | 3 | | 5

By gdx

Enlighted (6207)

gdx's picture

08-04-2023, 14:39

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?

By DarkSchneider

Paladin (1011)

DarkSchneider's picture

08-04-2023, 15:31

Because I think on MSX B (A8-15) is not connected or not used.

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 15:55

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.

By Accumulator

Champion (327)

Accumulator's picture

08-04-2023, 16:52

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.

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 17:55

Accumulator wrote:

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.

By DarkSchneider

Paladin (1011)

DarkSchneider's picture

08-04-2023, 18:43

It would be like having 256 pools, selected by B, of 256 8-bit ports.

By Accumulator

Champion (327)

Accumulator's picture

09-04-2023, 01:40

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..

By Accumulator

Champion (327)

Accumulator's picture

11-04-2023, 03:32

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...

By gdx

Enlighted (6207)

gdx's picture

12-04-2023, 13:26

Grauw wrote:

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?

By gdx

Enlighted (6207)

gdx's picture

12-04-2023, 15:22

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.

Page 4/5
1 | 2 | 3 | | 5