Prev: B668 Up: Map Next: B68F
B67B: Clears a data structure to all zeroes.
Used by the routines at _873a, _87c9 and Print_WarningMessage.
Input
STACK Holds address of data info (Address, length)
Using the return address to hold information is a common and fast way to pass in arguments.
The data will look something like:
BYTE VALUE
0000 call 6b7b
0003 WORD holding address
0005 BYTE holding length
0006 rest of function
Data_ClearToZero B67B XOR A Clear as value stored.
B67C POP HL Get return address from stack, this holds the address of data.
B67D LD E,(HL)
B67E INC HL
B67F LD D,(HL)
B680 LD (DE),A
B681 INC HL
B682 LD C,(HL) it also holds numer of bytes in data.
B683 INC HL Put next address back as the true return address just after the data info.
B684 PUSH HL
B685 LD L,E Clear the first byte of data.
B686 LD H,D
B687 INC DE
B688 DEC C
B689 RET Z
B68A LD B,$00 If the data is longer, clear the rest of it as well.
B68C LDIR
B68E RET
Prev: B668 Up: Map Next: B68F