×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library

9DCD '<' operator

Submitted by Steve Fewell

Description:

Check the next character from the BASIC Input line. If the next character is '=' then
the operator is '<=' Less Than or Equal To, so jump to &9DE1 to handle this operator.
If the next character is '>' then the operator is '<>' Not Equal To, so jump to &9DEC
to handle this operator.
Otherwise the operator is '<' Less Than. which is handled as follows:

Call &9CC9 to Compare the current value with the second value and set the flags
according to which value is greater, or whether the values are equal.

If the carry flag is clear then the first value is less than the second, so set the
IWA to TRUE; otherwise, the first value is not less than the second, so set the IWA to FALSE.
Exit with A = #&40 (as we are currently handling an Integer value).


Disassembly for the '<' Operator routine

9DCD   170 AA TAX
9DCE   164 027 A4 1B LDY &1B
9DD0   177 025 B1 19 LDA (&19),Y
9DD2 = 201 061 C9 3D CMP#&3D '='
9DD4   240 011 F0 0B BEQ 11 --> &9DE1 '<=' Less Than or Equal Operator
9DD6 > 201 062 C9 3E CMP#&3E '>'
9DD8   240 018 F0 12 BEQ 18 --> &9DEC '<>' Not Equal Operator
9DDA   032 201 156 20 C9 9C JSR &9CC9 Compare Values
9DDD   144 226 90 E2 BCC -30 --> &9DC1 Set TRUE
9DDF   128 225 80 E1 BRA -31 --> &9DC2 Set FALSE

 


 Back to 8BS
Or