Submitted by Steve Fewell
Routine:ReadIObyte
Name: Read byte from I/I processor memory
Starting Address: &BEE2
Entry criteria: The IWA contains the address of the required I/O processor memory location.
Exit: The IWA has been incremented by 1.
A contains the byte at the specified location.
Description:
Store X on the stack while the OSWORD call (below) is set up and performed.
Set A to #&05, X to #&2A and Y to #&00 as the parameter block location is &002A.
Call OSWORD (A = 5) to read byte from I/O processor memory.
The parameter block for the OSWORD 5 call contains the following:
* &2A - I/O processor memory address (LSB)
* &2B - I/O processor memory address byte 2
* &2C - I/O processor memory address byte 3
* &2D - I/O processor memory address (LSB)
* &2E - Returned value: the byte at the I/O processor memory address location
Retrieve X from the stack.
BEE2 | 169 005 | A9 05 | LDA#&05 | |
BEE4 | 218 | DA | PHX | |
BEE5 | * | 162 042 | A2 2A | LDX#&2A |
BEE7 | 160 000 | A0 00 | LDY#&00 | |
BEE9 | 032 241 255 | 20 F1 FF | JSR &FFF1 OSWORD | |
BEEC | 250 | FA | PLX | |
BEED | . | 165 046 | A5 2E | LDA &2E |
BEEF | ..Increment IWA value... |