Prev: 53250 Up: Map Next: 53283
53275: Negate HL
Used by the routines at HandlePointer and CheckOverlap.
Makes HL negative.
Input
HL The word
Output
HL The negative of the word
Invert both bytes, then add one.
NegateHL 53275 LD A,L Invert the low byte.
53276 CPL
53277 LD L,A
53278 LD A,H Invert the high byte.
53279 CPL
53280 LD H,A
53281 INC HL Add one.
53282 RET Return.
View the equivalent code in;
Prev: 53250 Up: Map Next: 53283