Routines |
Prev: A1D3 | Up: Map | Next: A219 |
|
||||||||
PrintStringColour | A1F3 | PUSH HL | Stash HL on the stack. | |||||
A1F4 | CALL ScreenAddress | Call ScreenAddress. | ||||||
A1F7 | LD A,(DE) | Fetch the attribute byte. | ||||||
A1F8 | EX AF,AF' | Switch to the shadow AF register. | ||||||
A1F9 | INC DE | Increment DE by one to point to the text of the string. | ||||||
A1FA | EXX | Switch to the shadow registers. | ||||||
A1FB | POP HL | Restore HL from the stack. | ||||||
A1FC | CALL AttributeAddress | Call AttributeAddress. | ||||||
This entry point is used by the routine at MenuWriteText.
|
||||||||
PrintString_Loop | A1FF | EXX | Switch back to the normal registers. | |||||
A200 | LD A,(DE) | Fetch the character to print. | ||||||
A201 | BIT 7,A | If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter. | ||||||
A203 | JR NZ,PrintString_LastCharacter | |||||||
A205 | CALL PrintCharacter | Call PrintCharacter. | ||||||
A208 | INC DE | Increment DE by one. | ||||||
A209 | EXX | Switch to the shadow registers. | ||||||
A20A | EX AF,AF' | Switch to the shadow AF register. | ||||||
A20B | LD (HL),A | Copy the attribute byte to the screen. | ||||||
A20C | INC L | Increment L by one. | ||||||
A20D | EX AF,AF' | Switch to the shadow AF register. | ||||||
A20E | JR PrintString_Loop | Jump to PrintString_Loop. | ||||||
Because the last character contains the terminator, it needs to be handled separately.
|
||||||||
PrintString_LastCharacter | A210 | AND %01111111 | Keep only bits 0-6 (i.e. strip the bit 7 terminator). | |||||
A212 | CALL PrintCharacter | Call PrintCharacter. | ||||||
A215 | EXX | Switch to the shadow registers. | ||||||
A216 | EX AF,AF' | Switch to the shadow AF register. | ||||||
A217 | LD (HL),A | Copy the attribute byte to the screen. | ||||||
A218 | RET | Return. | ||||||
View the equivalent code in;
|
Prev: A1D3 | Up: Map | Next: A219 |