8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly

Page Last Altered:

ADAC Evaluate expression and check for closing bracket

Submitted by Steve Fewell


This routine calls &9D3B to evaluate the expression contained at the current text
pointer location.
This will either return a String in the SWA, an Integer in the IWA or a Floating-Point
value in the FWA.
Next, it will check the next character found after the expression (returned in X).
If this character was not a closing bracket ')', then generate a "Missing )" error.
Otherwise, all is correct, so increment the text pointer (&1B),
set Y = Return Value Type (A) and exit the routine.

Disassembly for the Evaluate expression and check for Closing bracket routine

ADAC ; 032 059 157 20 3B 9D JSR &9D3B Evaluate expression
ADAF   230 027 E6 1B INC &1B
ADB1 ) 224 041 E0 29 CPX#&29
ADB3   208 233 D0 E9 BNE -23 --> &AD9E Missing ) error
ADB5   168 A8 TAY
ADB6 ` 096 60 RTS


 Back to 8BS