×   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

9DF5 '>' operator

Submitted by Steve Fewell

Description:

Check the next character from the BASIC Input line. If the next character is '=' then
the operator is '>=' Greater Than or Equal To, so jump to &9E07 to handle this operator.
Otherwise the operator is '>' Greater 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 zero flag is set then the values are equal, so set the IWA to FALSE, as the
first value is not greater than the second value.
If the carry flag is set then the first value is greater than the second, so set the
IWA to TRUE; otherwise, the first value is not greater 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

9DF5   170 AA TAX
9DF6   164 027 A4 1B LDY &1B
9DF8   177 025 B1 19 LDA (&19),Y
9DFA = 201 061 C9 3D CMP#&3D '='
9DFC   240 009 F0 09 BEQ 9 --> &9E07 '>=' Greater Than or Equal to Operator
9DFE   032 201 156 20 C9 9C JSR &9CC9 Compare Values
9E01   240 191 F0 BF BEQ -65 --> &9DC2 Set FALSE
9E03   176 188 B0 BC BCS -68 --> &9DC1 Set TRUE
9E05   128 187 80 BB BRA -69 --> &9DC2 Set FALSE

 


 Back to 8BS
Or