Submitted by Steve Fewell
Routine:adiv
Name: Floating-Point Division
Starting Address: &A5EE
Entry criteria: &4A and &4B (the argp) point to a 5-byte Floating-Point variable to be divided.
The FWA contains the value to divide by.
Exit: The FWA = [argp] / FWA [Normalised and Rounded].
Description:
If the FWA is zero, then issue a Division by Zero error.
Unpack the argp variable to the FWB. If the FWB is zero then exit with aclear [Clear FWA],
as the result will be zero. Otherwise, call the divide FWB by FWA division routine [&A5FA].
A5EE | 1 | 165 049 | A5 31 | LDA &31 |
A5F0 | 240 240 | F0 F0 | BEQ -16 --> &A5E2 [JMP &8172] Division by Zero error | |
A5F2 | 032 224 164 | 20 E0 A4 | JSR &A4E0 Unpack variable to FWB | |
A5F5 | 208 003 | D0 03 | BNE 3 --> &A5FA Floating-Point Division | |
A5F7 | L | 076 180 166 | 4C B4 A6 | JMP &A6B4 Clear FWA |