[Index] [Previous] [Next]

2.1 Utility Functions

Two small utility functions.

FWordToFloat

Converts the integer word in AB (A holds high byte, B holds low byte) to a floating-point number. BUG: This code is completely unused! The address of this function is stored at 0006, but nothing ever uses it. It's probably needed by 8K or other bigger BASICs, but has accidentally been compiled into this 4K version.

07F9 50 FWordToFloat MOV D,B
07FA 1E00 MVI E,00
07FC 0690 MVI B,90 exponent=2^16
07FE C3EA09 JMP FCharToFloat+5

 

FAddOneHalf

Adds 0.5 to FACCUM.

0801 210B0C FAddOneHalf LXI H,ONE_HALF Load BCDE with (float) 0.5.
0804 CD200A FAddMem CALL FLoadBCDEfromMem
0807 C31208 JMP FAdd+2

 


[Index] [Previous] [Next]