Prev: 64346 Up: Map Next: 64398
64347: Print String
Input
BC Screen co-ordinate
HL Pointer to string data
PrintString 64347 LD A,(HL) Fetch the character.
64348 AND %01111111 Keep only bits 0-6.
64350 PUSH HL Stash HL on the stack.
64351 SUB 32 A-=32.
64353 LD H,0 Create an offset using HL.
64355 LD L,A
64356 ADD HL,HL HL*=8.
64357 ADD HL,HL
64358 ADD HL,HL
64359 LD A,H H+=61.
64360 ADD A,61
64362 LD H,A
64363 LD A,B A=B.
64364 AND %11111000 Keep only bits 3-7.
64366 ADD A,107 A+=107.
64368 LD D,A D=A.
64369 LD A,B A=B.
64370 AND %00000111 Keep only bits 0-2.
64372 RRCA RRCA.
64373 RRCA
64374 RRCA
64375 ADD A,C A+=C.
64376 LD E,A E=A.
64377 PUSH BC Stash BC on the stack.
64378 LD B,8 B=8.
PrintString_Loop 64380 LD A,(HL) A=*HL.
64381 SRL A Shift A right.
64383 OR (HL) Set the bits from *HL.
64384 LD (DE),A Write A to *DE.
64385 INC HL Increment HL by one.
64386 INC D Increment D by one.
64387 DJNZ PrintString_Loop Decrease counter by one and loop back to PrintString_Loop until counter is zero.
64389 POP BC Restore BC from the stack.
64390 INC C Increment C by one.
64391 POP HL Restore HL from the stack.
64392 BIT 7,(HL) Return if bit 7 of *HL is set.
64394 RET NZ
64395 INC HL Increment HL by one.
64396 JR PrintString Jump to PrintString.
Prev: 64346 Up: Map Next: 64398