Prev: 53062 Up: Map Next: 53083
53071: Add Displacement
Used by the routine at MoveEntity.
Adds a signed displacement to a position that is held in three bytes.
Input
HL The displacement
C The top byte of the position
DE The bottom two bytes of the position
Output
C The new top byte
HL The new bottom two bytes
AddDisplacement 53071 BIT 7,H Jump to 53079 if the zero flag is reset.
53073 JR NZ,AddDisplacement_Skip
53075 ADD HL,DE HL takes DE.
53076 RET NC Return if the carry flag is reset.
53077 INC C Advance C.
53078 RET Return.
AddDisplacement_Skip 53079 ADD HL,DE HL takes DE.
53080 RET C Return if the carry flag is set.
53081 DEC C Step C back.
53082 RET Return.
Prev: 53062 Up: Map Next: 53083