×   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

Integer Positive Routine

Submitted by Steve Fewell

Routine: ipos
Name: Integer Positive
Starting Address: &ACBE
Entry criteria: The IWA contains the integer to make positive.
Exit: If the IWA contained a negative value, it will now be positive, otherwise IWA will be unchanged.

Description:
Check the most significant byte of the Integer Number in the IWA. If bit 7 of this byte is set [N flag], the IWA contains a negative number, so the icomp routine is jumped to (to compliment the value). Otherwise the routine exists with A = #&40, indicating that an Integer number is being processed. [Note: The code for this is located in the icomp routine].


Disassembly for the integer positive routine

ACBE $- 036 045 24 2D BIT &2D
ACC0 0 048 028 30 1C BMI 28 --> &ACDE Integer Compliment
ACC2 1 128 049 80 31 BRA 49 --> &ACF5 [LDA#&40 : RTS]


 Back to 8BS
Or