Prev: B873 Up: Map Next: B8CC
B8AD: Calculate Screen Address
ScreenAddress B8AD LD A,L A=L.
B8AE RRCA A=A / 08.
B8AF RRCA
B8B0 RRCA
B8B1 AND %00011111 Keep only bits 0-4.
B8B3 LD L,A L=A.
B8B4 LD A,H A=H.
B8B5 RLCA A=A * 04.
B8B6 RLCA
B8B7 AND %11100000 Keep only bits 5-7.
B8B9 OR L
B8BA LD L,A L=A.
B8BB LD A,H A=H.
B8BC AND %00000111 Keep only bits 0-2.
B8BE EX AF,AF' Switch to the shadow AF register.
B8BF LD A,H A=H.
B8C0 RRCA A=A / 08.
B8C1 RRCA
B8C2 RRCA
B8C3 AND %00011000 Keep only bits 3-4.
B8C5 OR %01000000 Set bit 6.
B8C7 LD H,A H=A.
B8C8 EX AF,AF' Switch to the shadow AF register.
B8C9 OR H
B8CA LD H,A H=A.
B8CB RET Return.
View the equivalent code in;
Prev: B873 Up: Map Next: B8CC