8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly

Page Last Altered:

9B52 Check for '=', get expression result & check end of statement

Submitted by Steve Fewell


If called from 9B46, then copy BASIC Text Pointer A to BASIC Text Pointer B.

Increment BASIC Text pointer B offset, load the next non-space character pointed to
by BASIC Text pointer B. If the next character is not '=' then issue a Mistake error, as
the current statement is not correct BASIC.
Otherwise, all is well, so jump to &9B8E, which does the following:
Evaluate the expression after the '='.
Then set A = X (this is the next non-space charater after the expression).
Next, load Y wth the BASIC Text pointer B offset (so that routine &9BB0 can update
the BASIC Text pointer A position correctly).
Finally, jump to &9BB0 to check for the end of statement (issuing a Syntax error if the
statement is not terminated correctly), and update BASIC Text Pointer A to point to the location
after the end of the current statement, and exit.

Disassembly for the Check for '=', get expression result & check end of statement routine

9B46   165 011 A5 0B LDA &0B
9B48   133 025 85 19 STA &19
9B4A   165 012 A5 0C LDA &0C
9B4C   133 026 85 1A STA &1A
9B4E   165 010 A5 0A LDA &0A
9B50   133 027 85 1B STA &1B
9B52   164 027 A4 1B LDY &1B
9B54   230 027 E6 1B INC &1B
9B56   177 025 B1 19 LDA (&19),Y
9B58   201 032 C9 20 CMP#&20
9B5A   240 246 F0 F6 BEQ -10 --> &9B52
9B5C = 201 061 C9 3D CMP#&3D
9B5E . 240 046 F0 2E BEQ 46 --> &9B8E Evaluate expression & check end of statement
9B60   ... Mistake error

Evaluate expression and check for end of statement
9B8E ; 032 059 157 20 3B 9D JSR &9D3B Evaluate expression
9B91   138 8A TXA
9B92   164 027 A4 1B LDY &1B
9B94   128 026 80 1A BRA 26 --> &9BB0 Check for end of Statement


 Back to 8BS