![]() |
Routines |
| Prev: 41427 | Up: Map | Next: 41497 |
|
||||||||
| PrintStringColour | 41459 | PUSH HL | Stash HL on the stack. | |||||
| 41460 | CALL ScreenAddress | Call ScreenAddress. | ||||||
| 41463 | LD A,(DE) | Fetch the attribute byte. | ||||||
| 41464 | EX AF,AF' | Switch to the shadow AF register. | ||||||
| 41465 | INC DE | Increment DE by one to point to the text of the string. | ||||||
| 41466 | EXX | Switch to the shadow registers. | ||||||
| 41467 | POP HL | Restore HL from the stack. | ||||||
| 41468 | CALL AttributeAddress | Call AttributeAddress. | ||||||
|
This entry point is used by the routine at MenuWriteText.
|
||||||||
| PrintString_Loop | 41471 | EXX | Switch back to the normal registers. | |||||
| 41472 | LD A,(DE) | Fetch the character to print. | ||||||
| 41473 | BIT 7,A | If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter. | ||||||
| 41475 | JR NZ,PrintString_LastCharacter | |||||||
| 41477 | CALL PrintCharacter | Call PrintCharacter. | ||||||
| 41480 | INC DE | Increment DE by one. | ||||||
| 41481 | EXX | Switch to the shadow registers. | ||||||
| 41482 | EX AF,AF' | Switch to the shadow AF register. | ||||||
| 41483 | LD (HL),A | Copy the attribute byte to the screen. | ||||||
| 41484 | INC L | Increment L by one. | ||||||
| 41485 | EX AF,AF' | Switch to the shadow AF register. | ||||||
| 41486 | JR PrintString_Loop | Jump to PrintString_Loop. | ||||||
|
Because the last character contains the terminator, it needs to be handled separately.
|
||||||||
| PrintString_LastCharacter | 41488 | AND %01111111 | Keep only bits 0-6 (i.e. strip the bit 7 terminator). | |||||
| 41490 | CALL PrintCharacter | Call PrintCharacter. | ||||||
| 41493 | EXX | Switch to the shadow registers. | ||||||
| 41494 | EX AF,AF' | Switch to the shadow AF register. | ||||||
| 41495 | LD (HL),A | Copy the attribute byte to the screen. | ||||||
| 41496 | RET | Return. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 41427 | Up: Map | Next: 41497 |