Prev: 49895 Up: Map Next: 49919
49901: Add To Score
Adds points to the score, which is held as BCD in the three bytes from Score, and then prints it.
The score is printed with two zeroes added to the end, so the points are in hundreds.
Input
BC The points to add, as BCD (in hundreds)
AddToScore 49901 LD HL,48075 Point at the last (lowest) byte of the score.
49904 LD A,(HL) Add the lowest two digits of the points to the lowest two digits of the score.
49905 ADD A,C
49906 DAA
49907 LD (HL),A
49908 DEC HL Move on to the middle byte of the score.
49909 LD A,(HL) Add the next two digits of the points to the next two digits of the score, with any carry.
49910 ADC A,B
49911 DAA
49912 LD (HL),A
49913 DEC HL Move on to the highest byte of the score.
49914 LD A,(HL) Add any carry to the highest two digits of the score.
49915 ADC A,0
49917 DAA
49918 LD (HL),A
Prev: 49895 Up: Map Next: 49919