Prev: F1B4 Up: Map Next: F1E0
F1C8: Take a number from LIFE's two digits
Used by the routine at DECLI1.
The author's DE1. A is split into tens (counted in B) and units; the units are taken from H, borrowing from the tens, and the tens from L. If that goes below nothing LIFE is 00.
Input
A The number, below 100
B $FF
L The tens
H The units
Output
HL The new tens and units
DE1 F1C8 INC B Tens into B, units into C
F1C9 SUB $0A
F1CB JR NC,DE1
F1CD ADD A,$0A
F1CF LD C,A
F1D0 LD A,H The units, borrowing a ten if need be
F1D1 SUB C
F1D2 JR NC,DE2
F1D4 ADD A,$0A
F1D6 INC B
DE2 F1D7 LD H,A DE2: the tens
F1D8 LD A,L
F1D9 SUB B
F1DA LD L,A
F1DB RET NC
F1DC XOR A Below nothing: 00
F1DD LD L,A
F1DE LD H,A
F1DF RET
Prev: F1B4 Up: Map Next: F1E0