8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

ADEC ADVAL

Submitted by Steve Fewell

Description:

Call routine &96B4 to obtain the Integer value from the expression after the ADVAL keyword (issue 'Type mismatch' error
if a String value was found).
Set X (the OSBYTE parameter) to the byte at location &2A (The LSB of the Integer ADVAL parameter obtained).
Perform the OSBYTE #&80 command to execute the ADVAL function.
On return, X will be the low byte (LSB) of the ADVAL return value and Y will be the high byte (MSB) of the ADVAL return
value.
Set A to the value of X (the LSB of the return value of the OSBYTE ADVAL call).
Call routine &AE1A to set the IWA to the 2-byte value of: A (low byte) and Y (high byte).


Disassembly for the ADVAL routine

ADEC   032 180 150 20 B4 96 JSR &96B4 Get Integer value at PTR B
ADEF * 166 042 A6 2A LDX &2A
ADF1   169 128 A9 80 LDA#&80
ADF3   032 244 255 20 F4 FF JSR &FFF4   OSBYTE
ADF6   138 8A TXA
ADF7 ! 128 033 80 21 BRA 33 --> &AE1A Set IWA to 16-bit value

 


 Back to 8BS
Or