> On Thursday 07 June 2001 13:07, you wrote:
> > Cool... And if so, I assume it must also be possible to use all address
> > lines for I/O ports higher than 0xff?
>
> Yes,
>  but you will get conflicts because all programs (including bios/basic etc)
> made up until now assumed that the hardware would only use the lower 8-bits
> and the value of the heighest 8-bits isn't used, so the programmers just
> ignored whatever value that could be in register B. This would mean that your
> 16-bit i/o address could be trigerred by accident. You have to consider the
> highest bit as containing "random" values.

Ah, this topic was ages ago, but ah, I'll just reply to it.

The value of register B is (when using outs and ins with register c, like out
(c),r and inir) indeed output to address lines A8-A15, and it's still definately
usable. Example: If you need 256 I/O spaces for some hardware you can reserve
one I/O port (that is the lower 8 bits), and then check the value of the MSB
(actually this is the Least Significant Byte instead of Most, but whatever). No
conflicts there as only software taking the higher 8 bits into consideration
will write to that port. So you can get 256 I/O addresses at the cost of only
one. The VDP, PSG, MoonSound or lots of other hardware could definately have
used it, no more seperate writes to specify the register number first, and then
the value. Damn, why didn't they do that? Would have been soooo easy! (you know
what, they should indeed have named the instructions out (bc),r!!! that would
have solved it immediately).

Ofcourse in this case memory-mapped I/O is also a good alternative since it is
much faster and easier to use and also more complex operations can be performed
on it (ldir and such). At the other hand, memory mapped I/O involves
bankswitching, which is a downside.

When using 16-bit I/O ports the number of usable instructions is a bit reduced,
or at least different. Only out (c),r and in r,(c) can be used for all i/o. Otir
and inir and such are actually also quite useful, they become some kind of ldir,
instead of in/outputting to the same i/o port all the time they increment the
MSB (which should be considered LSB) i/o address, which is imho absolutely not a
bad thing, as long as the hardware is designed for it. Aha! Now OTDR en INDR
appear to have a use after all (if you want to fill the upper 40
(msb-)ports...)!!! The instructions out (n),a and in a,(n) become a but unusable
though... I don't know if the lower 8 bits are mirrored in the higher 8 bits, or
if the higher 8 bits are simply zeroed (Zaks doesn't say anything about that),
in case of the latter there might still be some use for it, if you give the i/o
port with #00 as the MSB (which is actually rather a LSB :)) a more important
function. And those can ofcourse still be used for 8-bit I/O ports.

Alas, my story. Hope it is a bit understandable (it's late).


~Grauw


--
For info, see http://www.stack.nl/~wynke/MSX/listinfo.html

Reply via email to