×   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

A5EE Floating-Point Division Entry Point

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].


Disassembly for the Floating-Point Division Entry Point routine

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

 


 Back to 8BS
Or