Prev: 47833 Up: Map Next: 47881
47856: Clear display file
When this routine is entered via 47856 and 47862, B is set to zero. Upon reaching the DJNZ instruction (end of inner loop) at 47871, B is already zero, so the loop will execute 256 times, clearing one twelfth of the display file (two bytes cleared per PUSH, 256 PUSHes per loop).
Used by the routine at 37909.
47856 LD HL,0 Load zero (all bits reset) into HL
47859 LD BC,12 Load B with 0 (repeat inner loop 256 times) and C with 12 (repeat outer loop 12 times)
This entry point is used by the routine at 47833.
47862 DI Disable interrupts
47863 LD (47877),SP Store stack pointer at 47877
47867 LD SP,22528 Point stack pointer at start of attribute section of video memory
47870 PUSH HL Decrease current stack pointer position by two and load two zeroes into it
47871 DJNZ 47870 Loop back for next iteration
47873 DEC C Decrease C...
47874 JR NZ,47870 ...and repeat if C is still greater than zero, to clear the remaining eleven twelfths of the display file
The operand of the instruction at 47876 represents the original value in SP stored previously. This is modified by the instruction at 47863.
47876 LD SP,0 Restore stack pointer to original value
47879 EI Enable interrupts
47880 RET Return
Prev: 47833 Up: Map Next: 47881