Prev: 39842 Up: Map Next: 39890
39873: Screen Address One Pixel Below
Moves a screen buffer address down by one pixel line.
Input
HL The screen buffer address
Output
HL The screen buffer address of the line below
ScreenPosition1PixelBelow 39873 INC H Move down a pixel line.
39874 LD A,H Fetch the high byte of the address.
39875 AND %00000111 Keep only bits 0-2.
39877 RET NZ Return if a character boundary has not been crossed.
39878 LD A,L Fetch the low byte of the address.
39879 ADD A,32 Move down a character row.
39881 LD L,A Keep the new low byte in L.
39882 AND %11100000 Keep only bits 5-7.
39884 RET Z Return if the next third of the screen has been reached.
39885 LD A,H Fetch the high byte of the address.
39886 SUB 8 Subtract 8.
39888 LD H,A Keep the new high byte in H.
39889 RET Return.
View the equivalent code in;
Prev: 39842 Up: Map Next: 39890