Prev: 34166 Up: Map Next: 34459
34426: Print Character
Used by the routine at 34166.
Input
A ASCII value of character to print
Prints using the standard ZX Spectrum CHARSET.
PrintChar 34426 PUSH AF Push AF, BC, DE and HL on the stack.
34427 PUSH BC
34428 PUSH DE
34429 PUSH HL
34430 SUB 32 Create offset for the font graphic data look-up. For example;
Letter ASCII Value SUB 032 * 8 CHARSET + offset
"A" 065 033 264 15880
"Q" 081 049 392 16008
"a" 097 065 520 16136
34432 LD L,A
34433 LD H,0
34435 ADD HL,HL
34436 ADD HL,HL
34437 ADD HL,HL
34438 LD DE,15616 Calculate font graphic data address using CHARSET + offset.
34441 ADD HL,DE
34442 EX DE,HL Store the result in DE, restore the screen location to HL.
34443 POP HL
34444 PUSH HL
34445 LD B,8 Set a counter for $08 lines.
PrintChar_Loop 34447 LD A,(DE) Fetch the font byte and copy it to the screen.
34448 LD (HL),A
34449 INC DE Move onto the next font data byte.
34450 INC H Move the screen pointer down one row.
34451 DJNZ PrintChar_Loop Decrease counter by one and loop back to PrintChar_Loop until counter is zero.
34453 POP HL Restore HL, DE, BC and AF off the stack.
34454 POP DE
34455 POP BC
34456 POP AF
34457 INC L Move the screen pointer across one column, ready for printing the next character.
34458 RET Return.
Prev: 34166 Up: Map Next: 34459