Prev: 46469 Up: Map Next: 46511
46479: Print Small Number
Used by the routine at HallOfFame.
Prints a number stored as three BCD bytes using the normal character set, which is used in the hall of fame.
Input
DE Address of the number
HL Screen address
Output
DE Address after the number
HL Screen address after the number
PrintSmallNumber 46479 PUSH HL Save the screen address.
46480 LD HL,(23606) Fetch the address of the character set.
46483 LD (38424),HL Use it as the current character set.
46486 POP HL Restore the screen address.
PrintSmallNumber_Byte 46487 LD A,(DE) Fetch a byte of the number.
46488 RRCA Move the tens digit down into the bottom four bits.
46489 RRCA
46490 RRCA
46491 RRCA
46492 AND 15 Keep only that digit.
46494 ADD A,48 Convert it to the character code of the digit.
46496 CALL PrintScreen Print it using PrintScreen.
46499 LD A,(DE) Fetch the byte again.
46500 AND 15 Keep only the units digit.
46502 ADD A,48 Convert it to the character code of the digit.
46504 CALL PrintScreen Print it.
46507 INC DE Move on to the next byte of the number.
46508 DJNZ PrintSmallNumber_Byte Loop back until all of the bytes have been printed.
46510 RET Return.
Prev: 46469 Up: Map Next: 46511