Prev: D5A3 Up: Map Next: D5CA
D5B0: Character Index
Returns the 16 bit memory location of a character from a given character index in A.
Character_Address D5B0 LD H,$00 Using Character_00 as a base address (which is the first character), this works out the character frame from a given index passed in A. To give an example with $1A;
  • Loads $1A as the low-order byte; HL=$001A
  • Times by $200; store this in DE=$3400
  • Loads $1A as the low-order byte; HL=$001A
  • Times by $10; HL=$1A0
  • HL+DE=$35A0
  • Add $6800=Character_26
D5B2 LD L,A
D5B3 ADD HL,HL
D5B4 ADD HL,HL
D5B5 ADD HL,HL
D5B6 ADD HL,HL
D5B7 ADD HL,HL
D5B8 ADD HL,HL
D5B9 ADD HL,HL
D5BA ADD HL,HL
D5BB ADD HL,HL
D5BC EX DE,HL
D5BD LD H,$00
D5BF LD L,A
D5C0 ADD HL,HL
D5C1 ADD HL,HL
D5C2 ADD HL,HL
D5C3 ADD HL,HL
D5C4 ADD HL,DE
D5C5 LD DE,$6800
D5C8 ADD HL,DE
D5C9 RET Returns the address in HL.
Prev: D5A3 Up: Map Next: D5CA