Two functions : the first is for unpacking the mantissas of two floating-point numbers, the second is for comparing two floating-point numbers.
Unpacks the mantissas of FACCUM and BCDE. This is simple enough - we just restore the missing most-significant bit, invariably a 1 (see tech note). Unfortunately, doing this loses the sign bits of both packed numbers.
To compensate for this, a combination of both signs is returned. Duing the function FACC's sign is negated and later xor'ed with BCDE's sign, and returned in bit 7 of A. The effect of this is when the function returns, A is +ve if the signs mismatched, or -ve if the signs matched.
|0A3B||07||RLC||Move FACCUM's sign to bit 0.|
|0A3C||37||STC||Set MSB of FACCUM mantissa,|
|0A3D||1F||RAR||FACCUM's sign is now in carry.|
|0A3F||3F||CMC||Negate FACCUM's sign.|
|0A40||1F||RAR||Bit 7 of A is now FACCUM's sign.|
|0A41||23||INX H||Store negated FACCUM sign at FTEMP_SIGN.|
|0A45||07||RLC||Set MSB of BCDE mantissa,|
|0A46||37||STC||BCDE's sign is now in carry.|
|0A49||1F||RAR||Bit 7 of A is now BCDE's sign|
|0A4A||AE||XRA M||XORed with FTEMP_SIGN.|
Compares FACCUM to BCDE, with the result being returned in A as follows :
FACCUM > BCDE, A = 0x01.
FACCUM < BCDE, A = 0xFF.
FACCUM = BCDE, A = 0.
|If BCDE is zero, then we don't need to compare and can just return via FTestSign.|
|Set return address to InvSignToInt|
|Test FACCUM's sign, and return with A=the inverse of BCDE's sign if FACCUM is zero.|
|Call function to test for equality. If BCDE and FACCUM are equal, then this function will not return here, but to FCompare's caller.|
|Not equal. We get the carry flag (indicating greater/lesser relationship) into bit 7 of A and then XOR that with ??? and return to 09DE.|
|Test for equality between BCDE and FACCUM.|
|Equality, ie BCDE==FACCUM. In this case we can lose the first two return addresses on the stack, and return the caller of FCompare.|
|0A74||E1||POP H||Lose 0A5E|
|0A75||E1||POP H||Lose 09DE|
|0A76||C9||RET||Return to caller|