Prev: BAB4 Up: Map Next: BAD8
BACE: Helper: Count Bytes To Terminator
Used by the routine at Handler_DisplayCharacterLocation.
Input
HL Data to examine
Output
B Number of bytes till the terminator
CountBytesToTerminator BACE LD B,$00 B=00.
CountBytesToTerminator_Loop BAD0 LD A,(HL) A=*HL.
BAD1 CP $FF If A is FF then return.
BAD3 RET Z
BAD4 INC B Increment B by one.
BAD5 INC HL Increment HL by one.
BAD6 JR CountBytesToTerminator_Loop Jump to CountBytesToTerminator_Loop.
Prev: BAB4 Up: Map Next: BAD8