Prev: 3506 Up: Map Next: 351B
350B: THE 'ZERO OR ONE' SUBROUTINE
Used by the routines at e_to_fp, f_not, no_or_no and no_and_no.
The routine at less_0 continues here.
This subroutine sets the 'last value' to zero if the carry flag is reset and to one if it is set. When called from e_to_fp however it creates the zero or one not on the stack but in mem-0.
Input
HL Address of the first byte of the number
F Carry set for 1, reset for 0
FP_0_1 350B PUSH HL Save the result pointer.
350C LD A,$00 Clear A without disturbing the carry.
350E LD (HL),A Set the first byte to zero.
350F INC HL Point to the second byte.
3510 LD (HL),A Set the second byte to zero.
3511 INC HL Point to the third byte.
3512 RLA Rotate the carry into A, making A one if the carry was set, but zero if the carry was reset.
3513 LD (HL),A Set the third byte to one or zero.
3514 RRA Ensure that A is zero again.
3515 INC HL Point to the fourth byte.
3516 LD (HL),A Set the fourth byte to zero.
3517 INC HL Point to the fifth byte.
3518 LD (HL),A Set the fifth byte to zero.
3519 POP HL Restore the result pointer.
351A RET
Prev: 3506 Up: Map Next: 351B