Prev: 6BE6 Up: Map Next: 6BFE
6BF6: 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 6BF6 LD A,L Invert the low byte.
6BF7 CPL
6BF8 LD L,A
6BF9 LD A,H Invert the high byte.
6BFA CPL
6BFB LD H,A
6BFC INC HL Increment HL by one.
6BFD RET Return.
View the equivalent code in;
Prev: 6BE6 Up: Map Next: 6BFE