Prev: 54691 Up: Map Next: 54730
54704: Character Index
Returns the 16 bit memory location of a character from a given character index in A.
Character_Address 54704 LD H,0 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
54706 LD L,A
54707 ADD HL,HL
54708 ADD HL,HL
54709 ADD HL,HL
54710 ADD HL,HL
54711 ADD HL,HL
54712 ADD HL,HL
54713 ADD HL,HL
54714 ADD HL,HL
54715 ADD HL,HL
54716 EX DE,HL
54717 LD H,0
54719 LD L,A
54720 ADD HL,HL
54721 ADD HL,HL
54722 ADD HL,HL
54723 ADD HL,HL
54724 ADD HL,DE
54725 LD DE,26624
54728 ADD HL,DE
54729 RET Returns the address in HL.
Prev: 54691 Up: Map Next: 54730