×   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

A5E9 Floating-Point Reciple (FWA=1/FWA)

Submitted by Steve Fewell

Routine:areciple
Name: Floating-Point Reciple
Starting Address: &A5E9
Entry criteria: The FWA Contains a Floating-Point value.
Exit: The FWA contains the value of FWA = 1 / FWA.

Description:

Set argp to point to the Floating-Point Constant at &BF92 which contains the value 1.0.
This value is stored in the Floating-Point Constant table.
Jump to the Floating-Point divide routine to set the FWA to: FWA = argp / FWA.
The FWA will now contain the reciple value of the previous value in the FWA.


Disassembly for the Floating-Point Reciple routine

A5E9   169 146 A9 92 LDA#&92
A5EB   032 139 165 20 8B A5 JSR &A58B
A5EE ...Floating-Point Divide

Disassembly for the A58B Set argp to &BF00 + A

A589 . 169 046 A9 2E LDA#&2E
A58B J 133 074 85 4A STA &4A
A58D   169 191 A9 BF LDA#&BF
A58F K 133 075 85 4B STA &4B
A591 ` 096 60 RTS

 


 Back to 8BS
Or