![]() |
Routines |
| Prev: 50061 | Up: Map | Next: 51978 |
|
|
||||
| PrintNumbers | 51891 | LD A,0 | A=0. | |
| 51893 | RLD | RLD. | ||
| 51895 | PUSH AF | Stash AF on the stack. | ||
| 51896 | CP 0 | Jump to PrintNumbers_1 if A is not 0. | ||
| 51898 | JR NZ,PrintNumbers_1 | |||
| 51900 | LD A,32 | A=32. | ||
| 51902 | CALL PrintNumbers_Print | Call PrintNumbers_Print. | ||
| 51905 | POP AF | Restore AF from the stack. | ||
| 51906 | RLD | RLD. | ||
| 51908 | PUSH AF | Stash AF on the stack. | ||
| 51909 | CP 0 | Jump to PrintNumbers_2 if A is not 0. | ||
| 51911 | JR NZ,PrintNumbers_2 | |||
| 51913 | LD A,32 | A=32. | ||
| 51915 | CALL PrintNumbers_Print | Call PrintNumbers_Print. | ||
| 51918 | POP AF | Restore AF from the stack. | ||
| 51919 | RLD | RLD. | ||
| 51921 | DEC HL | Decrease HL by one. | ||
| 51922 | DJNZ PrintNumbers | Decrease counter by one and loop back to PrintNumbers until counter is zero. | ||
| 51924 | RET | Return. | ||
| PrintNumbers_0 | 51925 | LD A,0 | A=0. | |
| 51927 | RLD | RLD. | ||
| 51929 | PUSH AF | Stash AF on the stack. | ||
| PrintNumbers_1 | 51930 | ADD A,48 | A+=48. | |
| 51932 | CALL PrintNumbers_Print | Call PrintNumbers_Print. | ||
| 51935 | POP AF | Restore AF from the stack. | ||
| 51936 | RLD | RLD. | ||
| 51938 | PUSH AF | Stash AF on the stack. | ||
| PrintNumbers_2 | 51939 | ADD A,48 | A+=48. | |
| 51941 | CALL PrintNumbers_Print | Call PrintNumbers_Print. | ||
| 51944 | POP AF | Restore AF from the stack. | ||
| 51945 | RLD | RLD. | ||
| 51947 | DEC HL | Decrease HL by one. | ||
| 51948 | DJNZ PrintNumbers_0 | Decrease counter by one and loop back to PrintNumbers_0 until counter is zero. | ||
| 51950 | RET | Return. | ||
|
This is similar in functionality to PrintString. It differs as it doesn't use a terminator rather the length is known.
|
||||
| PrintNumbers_Print | 51951 | PUSH HL | Stash HL and BC on the stack. | |
| 51952 | PUSH BC | |||
| 51953 | LD L,A | L=A. | ||
| 51954 | LD H,0 | H=0. | ||
| 51956 | ADD HL,HL | HL*=8. | ||
| 51957 | ADD HL,HL | |||
| 51958 | ADD HL,HL | |||
| 51959 | LD BC,58391 | BC=Font. | ||
| 51962 | DEC B | Decrease B by one. | ||
| 51963 | ADD HL,BC | HL+=BC. | ||
| 51964 | PUSH DE | Stash DE on the stack. | ||
| 51965 | LD B,8 | B=8 (counter). | ||
| PrintNumbers_Print_Loop | 51967 | LD A,(HL) | A=*HL. | |
| 51968 | LD (DE),A | Write A to *DE. | ||
| 51969 | INC HL | Increment HL by one. | ||
| 51970 | INC D | Increment D by one. | ||
| 51971 | DJNZ PrintNumbers_Print_Loop | Decrease counter by one and loop back to PrintNumbers_Print_Loop until counter is zero. | ||
| 51973 | POP DE | Restore DE from the stack. | ||
| 51974 | INC DE | Increment DE by one. | ||
| 51975 | POP BC | Restore BC and HL from the stack. | ||
| 51976 | POP HL | |||
| 51977 | RET | Return. | ||
| Prev: 50061 | Up: Map | Next: 51978 |