8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

AAFF PI

Submitted by Steve Fewell

Description:

Call the &A8BE routine to load the FWA with the Floating-Point constant at
location &BF2E in the Floating-Point constant table.
The constant value at &BF2E is 1.57079633. This value is Pi / 2.
Add 1 to the exponent to multiply this value by 2, this will give Pi as the result.
Exit with the FWA set to Pi (3.14159266).


Disassembly for the PI routine

AAFF   032 190 168 20 BE A8 JSR &A8BE Load FWA with &BF2E value (PI/2)
AB02 0 230 048 E6 30 INC &30
AB04 ` 096 60 RTS

Disassembly for A8BE: the Load FWA with &BF2E value (PI/2) routine

A8BE . 169 046 A9 2E LDA#&2E
A8C0 L 076 150 168 4C 96 A8 JMP &A896 Set FWA to the FP constant at &BF00 + A

 


 Back to 8BS
Or