Prev: 30A9 Up: Map Next: 30CA
30C0: THE 'PREPARE TO MULTIPLY OR DIVIDE' SUBROUTINE
Used by the routines at multiply and division.
This subroutine prepares a floating-point number for multiplication or division, returning with carry set if the number is zero, getting the sign of the result into the A register, and replacing the sign bit in the number by the true numeric bit, 1.
Input
A Bit 7 holds 0 on the first call, or the sign bit of the first number
HL Address of the first byte of the number
Output
A Bit 7 holds the sign bit of the first number, or the sign bit of the product/quotient
F Carry flag set if the number is zero
PREP_M_D 30C0 CALL TEST_ZERO If the number is zero, return with the carry flag set.
30C3 RET C
30C4 INC HL Point to the sign byte.
30C5 XOR (HL) Get sign for result into A (like signs give plus, unlike give minus); also reset the carry flag.
30C6 SET 7,(HL) Set the true numeric bit.
30C8 DEC HL Point to the exponent again.
30C9 RET Return with carry flag reset.
Prev: 30A9 Up: Map Next: 30CA