×   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

ACD7 Complement Result (get result then complement it)

Submitted by Steve Fewell

Routine: resultcomp
Name: Compliment Result
Starting Address: &ACD7

Description:
Calls AD4C to get the result of the expression (AD4C is part of the evaluate
expression/get next value from the command line/program routine).

If the return type of the result is 0 then a string was found; so, as this routine
requires a numerical result, a Type Mismatch error is generated.
If the return type of the result is negative (i.e. &FF) then a floating-point number
was found; so exit the routine via the Float Compliment routine [&ACCA].
Otherwise an integer was found (result type is &40). So, exit the routine via the
Integer Complement routine [&ACDE].

Disassembly for the compliment result routine

ACD7 L 032 076 173 20 4C AD JSR &AD4C
ACDA   240 216 F0 D8 BEQ -40 --> &ACB4 [JMP &9092 - Type Mismatch error]
ACDC 0 048 236 30 EC BMI -20 --> &ACCA Float Compliment
ACDE ...&ACDE Integer Compliment


 Back to 8BS
Or