8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

ABB3 ASC

Submitted by Steve Fewell

Description:

Call the Evaluate value routine (&AD36) which will evaluate the next value at BASIC text
pointer B location, or the expression at that location if the value begins with an open bracket ("(").
If the obtained value is not a String (A is not 0) then generate a Type mismatch error as a string is required.

If the length of the String (&36, the length of the SWA) is 0 then set the IWA
to -1 and exit, as a zero length string does not have a valid ASCII code!.

Otherwise, Load A with the ASCII code of the first character and jump to routine &AE18 to set the IWA to the
8-bit value of A and exit.


Disassembly for the ASC routine

ABB3 6 032 054 173 20 36 AD JSR &AD36 Evaluate value
ABB6   208 020 D0 14 BNE 20 --> &ABCC [JMP &9092 - Type mismatch error]
ABB8 6 165 054 A5 36 LDA &36
ABBA   240 031 F0 1F BEQ 31 --> &ABDB Set IWA to -1
ABBC   173 000 006 AD 00 06 LDA &0600
ABBF L 076 024 174 4C 18 AE JMP &AE18 Set IWA to 8-bit value in A

 


 Back to 8BS
Or