8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly

Page Last Altered:

A68D Floating-Point Addition Entry Point

Submitted by Steve Fewell

Name: Floating-Point Addition
Starting Address: &A68D
Entry criteria: &4A and &4B (the argp) point to a 5-byte Floating-Point variable to add.
The FWA contains the other value to add.
Exit: The FWA = [argp] + FWA [Normalised and Rounded].


Calls &A4E0 to unpack the variable pointed to by argp (&4A, &4B) to the
If the unpacked variable is zero (Mantissa byte 1 is 0) then exit as there is nothing to add.
Call the Floating Point Addition routine [FWA = FWA + FWB] to actually do the addition.
Continue to the 'Round FWA Mantissa to 4 bytes' routine at address &A695
so that we can exit with the resulted rounded and the Mantissa rounding byte clear.

If called from &A692 then just the FWA = FWA + FWB calculation is done and the
FWA Mantissa is rounded to 4 bytes before exiting.

Disassembly for the Floating-Point Addition Entry Point routine

A68D   032 224 164 20 E0 A4 JSR &A4E0 Unpack argp variable to FWB
A690 2 240 050 F0 32 BEQ 50 --> &A6C4 [RTS]
A692 h 032 104 131 20 68 83 JSR &8368 Floating-Point Addition
A695   ... Round FWA Mantissa to 4-bytes (loose rounding byte)


 Back to 8BS