Prev: 76D0 Up: Map Next: 7702
76E3: Calculate Screen Address
Used by the routines at 5FE1, MenuWriteText, 7378, PrintString, 7557 and 7584.
ScreenAddress 76E3 LD A,L A=L.
76E4 RRCA A=A / 08.
76E5 RRCA
76E6 RRCA
76E7 AND %00011111 Keep only bits 0-4.
76E9 LD L,A L=A.
76EA LD A,H A=H.
76EB RLCA A=A * 04.
76EC RLCA
76ED AND %11100000 Keep only bits 5-7.
76EF OR L
76F0 LD L,A L=A.
76F1 LD A,H A=H.
76F2 AND %00000111 Keep only bits 0-2.
76F4 EX AF,AF' Switch to the shadow AF register.
76F5 LD A,H A=H.
76F6 RRCA A=A / 08.
76F7 RRCA
76F8 RRCA
76F9 AND %00011000 Keep only bits 3-4.
76FB OR %01000000 Set bit 6.
76FD LD H,A H=A.
76FE EX AF,AF' Switch to the shadow AF register.
76FF OR H
7700 LD H,A H=A.
7701 RET Return.
View the equivalent code in;
Prev: 76D0 Up: Map Next: 7702