Prev: 46222 Up: Map Next: 46265
46257: Negate HL
Negates HL. This routine is not used.
Input
HL The word
Output
HL The negative of the word
Invert both bytes, then add one.
NegateHL 46257 LD A,L Invert the low byte.
46258 CPL
46259 LD L,A
46260 LD A,H Invert the high byte.
46261 CPL
46262 LD H,A
46263 INC HL Add one.
46264 RET Return.
View the equivalent code in;
Prev: 46222 Up: Map Next: 46265