Prev: 49002 Up: Map Next: 49042
49022: Get Entity Address
Finds the address of an entity from its number. The entities are 16 bytes long and this uses 8, so it does not work. It is not used.
Input
A Entity number
Output
IY Address
GetEntityAddress 49022 PUSH BC Save BC.
49023 LD C,A Put the entity number in BC.
49024 LD B,0
49026 PUSH BC Move it into IY.
49027 POP IY
49029 ADD IY,IY Multiply it by eight.
49031 ADD IY,IY
49033 ADD IY,IY
49035 LD BC,38544 Add the address of the first entity.
49038 ADD IY,BC
49040 POP BC Restore BC.
49041 RET Return.
Prev: 49002 Up: Map Next: 49042