![]() |
Routines |
| Prev: 27183 | Up: Map | Next: 27240 |
|
Prints flag B as a decimal number followed by a space. The conversion goes through the DAA instruction, so the flag is treated as two decimal digits.
|
||||
| PrintFlag | 27196 | CALL FlagAddress | Read flag B. Zero prints as a single 0. | |
| 27199 | LD A,(HL) | |||
| 27200 | OR A | |||
| 27201 | JR Z,PrintFlag_High | |||
| 27203 | LD B,A | Count that value through DAA. | ||
| 27204 | XOR A | |||
| PrintFlag_Tens | 27205 | INC A | Each pass through DAA builds one decimal step. | |
| 27206 | DAA | |||
| 27207 | DJNZ PrintFlag_Tens | |||
| PrintFlag_High | 27209 | PUSH AF | The high digit is the tens. | |
| 27210 | OR A | |||
| 27211 | JR Z,PrintFlag_Units | |||
| 27213 | SRL A | Shift the tens digit down. | ||
| 27215 | SRL A | |||
| 27217 | SRL A | |||
| 27219 | SRL A | |||
| 27221 | ADD A,48 | Print the tens digit when it is not zero. | ||
| 27223 | CALL PrintCharacter | |||
| PrintFlag_Units | 27226 | POP AF | Print the units digit. | |
| 27227 | AND 15 | |||
| 27229 | ADD A,48 | |||
| 27231 | CALL PrintCharacter | |||
| 27234 | LD A,32 | Print a following space. | ||
| 27236 | CALL PlotCharacter | |||
| 27239 | RET | Return. | ||
| Prev: 27183 | Up: Map | Next: 27240 |