Prev: 27622 Up: Map Next: 27646
27638: Negate HL
Used by the routines at LocateRadarBlip, HandlerCar, DrawObjects and GetMapDistance.
Makes HL negative.
Input
HL The word
Output
HL The negative of the word
Invert both bytes, then add one.
NegateHL 27638 LD A,L Invert the low byte.
27639 CPL
27640 LD L,A
27641 LD A,H Invert the high byte.
27642 CPL
27643 LD H,A
27644 INC HL Increment HL by one.
27645 RET Return.
View the equivalent code in;
Prev: 27622 Up: Map Next: 27646