8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly

Page Last Altered:

BEE2 Read byte from I/O processor (at the address in IWA) & increment IWA

Submitted by Steve Fewell

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.


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.

Disassembly for the Read byte from I/O processor at address (IWA) & increment IWA routine

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
BEED . 165 046 A5 2E LDA &2E
BEEF ..Increment IWA value...


 Back to 8BS