![]() |
Routines |
| Prev: 6A2F | Up: Map | Next: 6A68 |
|
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 | 6A3C | CALL FlagAddress | Read flag B. Zero prints as a single 0. | |
| 6A3F | LD A,(HL) | |||
| 6A40 | OR A | |||
| 6A41 | JR Z,PrintFlag_High | |||
| 6A43 | LD B,A | Count that value through DAA. | ||
| 6A44 | XOR A | |||
| PrintFlag_Tens | 6A45 | INC A | Each pass through DAA builds one decimal step. | |
| 6A46 | DAA | |||
| 6A47 | DJNZ PrintFlag_Tens | |||
| PrintFlag_High | 6A49 | PUSH AF | The high digit is the tens. | |
| 6A4A | OR A | |||
| 6A4B | JR Z,PrintFlag_Units | |||
| 6A4D | SRL A | Shift the tens digit down. | ||
| 6A4F | SRL A | |||
| 6A51 | SRL A | |||
| 6A53 | SRL A | |||
| 6A55 | ADD A,$30 | Print the tens digit when it is not zero. | ||
| 6A57 | CALL PrintCharacter | |||
| PrintFlag_Units | 6A5A | POP AF | Print the units digit. | |
| 6A5B | AND $0F | |||
| 6A5D | ADD A,$30 | |||
| 6A5F | CALL PrintCharacter | |||
| 6A62 | LD A,$20 | Print a following space. | ||
| 6A64 | CALL PlotCharacter | |||
| 6A67 | RET | Return. | ||
| Prev: 6A2F | Up: Map | Next: 6A68 |