Prev: 917A Up: Map Next: 91E8
919D: Add value of coal to the current score
Used by the routine at 935C.
Input
A Score to add
919D LD B,A Start a loop based on the score value.
919E LD A,$0A Flag $0A as the digit requiring decimal adjustment.
91A0 LD IX,$9217 Point to the score (9217).
91A4 INC (IX+$00) Increment the score, but jump forward if it reaches 0A.
91A7 CP (IX+$00)
91AA JR Z,$91B2
91AC DJNZ $91A4 Otherwise loop back round and add more.
91AE CALL $91E8 Print the score and return.
91B1 RET
The score needs adjusting for decimal.
91B2 LD (IX+$00),$00 Carry the 10s.
91B6 INC (IX+$01)
91B9 CP (IX+$01) Continue if there is no more overflow.
91BC JR NZ,$91AC
91BE LD (IX+$01),$00 Carry the 100s.
91C2 INC (IX+$02)
91C5 CP (IX+$02) Continue if there is no more overflow.
91C8 JR NZ,$91AC
91CA LD (IX+$02),$00 Carry the 1000s.
91CE INC (IX+$03)
91D1 CP (IX+$03) Continue if there is no more overflow.
91D4 JR NZ,$91AC
91D6 LD (IX+$03),$00 Carry the 10,000s.
91DA INC (IX+$04)
91DD CP (IX+$04) Continue if there is no more overflow.
91E0 JR NZ,$91AC
91E2 LD (IX+$04),$00 The maximum possible score is 99,999 - overflow to 0 and continue.
91E6 JR $91AC
Prev: 917A Up: Map Next: 91E8