×   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

9D66 'EOR' operator

Submitted by Steve Fewell

Description:

[9D7B] Convert the first value (current value) to an integer (if it's a Float).
If the first value is a string then issue a ype Mismatch error.
Push the first value to the stack.
[9D81] Get the next value (expression handler level 2 [AND]). For the next value
we only need to search the operators with higher precedence, as these must be evaluated
before we have the correct second value that we need. If the value obtained is a float
then convert it to an integer (if it's a string then Type Mismatch error).

EOR the Integer on the stack (first value) with the Integer in the IWA (second value)
storing the result in the IWA.
We now have the result we require.

Reclaim the stack space, set A = #&40 (as we are handling an Integer) and jump to
&9D3E to check for further OR/EOR operators which need to be processed.


Disassembly for the 'EOR' Operator routine

9D66 { 032 123 157 20 7B 9D JSR &9D7B Convert to Int, push to Stack & Get next value
9D69   032 190 150 20 BE 96 JSR &96BE Check for Integer & convert if Float
9D6C   160 003 A0 03 LDY#&03
9D6E   177 004 B1 04 LDA (&04),Y
9D70 Y* 089 042 000 59 2A 00 EOR &002A,Y
9D73 * 153 042 000 99 2A 00 STA &002A,Y
9D76   136 88 DEY
9D77   016 245 10 F5 BPL -11 --> &9D6E
9D79   128 228 80 E4 BRA -28 --> &9D5F Reclaim stack space & Expression handler level 1

 


 Back to 8BS
Or