On 8/8/2006 at 3:35 PM Don wrote:
Having B appear on the address bus is a nice way of
combining
an IN and OUT instruction into a single operation. I often
exploit this when decoding key matrixes, etc. (i.e. set
B to whatever you want to appear on the row drivers, C to
the IO address for the "keyboard" and do an IN A,C)
Yes! I prefer to think of it as a 16-bit port address. But the idea's the
same, instead of latching an index value into a register file on a device,
one can simply use the value of the B register as the index and do away wit
hthe latch entirely, saving valuable time.
The NSC800 has a configuration port at 0bbh, which can be modified with the
register-indirect form of the OUT instruction, but not the immediate-port
form.
Cheers,
Chuck