Prev: 92E4 Up: Map Next: 932C
92FF: Expand Time Byte To ASCII
Time_Counter 92FF DEFB $F0,$D8 Guessing at the length.
9301 DEFB $18,$FC
9303 DEFB $9C,$FF
9305 DEFB $F6,$FF
9307 DEFB $FF,$FF Terminator.
On entry HL contains the time as the LSB, e.g. for 30s HL will be 001E.
Process_Time 9309 PUSH HL Pushes HL, DE and BC onto the stack.
930A PUSH DE
930B PUSH BC
930C LD DE,$92FF Point to Time_Counter.
Process_Time_Loop 930F LD A,(DE) Load the next byte pair from the address pointer into BC.
9310 LD C,A
9311 INC DE
9312 LD A,(DE)
9313 LD B,A
9314 INC DE Increase the address pointer by one and stash it on the stack for later.
9315 PUSH DE
9316 LD A,$2F Store 2F in A.
Count "up" from ASCII "0" until the correct representation is reached.
Process_Time_Char 9318 INC A Increment A by one (so on the first pass A will now contain ASCII "0").
9319 LD D,H Copy the remaining time into DE.
931A LD E,L
931B ADD HL,BC Adds the remaining time to the 16-bit number held in BC.
931C JR C,Process_Time_Char If the carry flag is set loop back to Process_Time_Char.
931E EX DE,HL Swap the DE and HL registers.
931F LD (IX+$00),A Write the processed ASCII number character to the time print buffer.
9322 INC IX Increment IX by one to process the next character in the time buffer once looped around.
9324 POP DE Restore the byte pair address pointer from the stack.
9325 INC C Loop back to Process_Time_Loop until the terminator is reached (FF+01 will set the zero flag).
9326 JR NZ,Process_Time_Loop
9328 POP BC Restores BC, DE and HL from the stack.
9329 POP DE
932A POP HL
932B RET Return.
Prev: 92E4 Up: Map Next: 932C