Prev: B48E Up: Map Next: B4B9
B4B1: 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 B4B1 LD A,L Invert the low byte.
B4B2 CPL
B4B3 LD L,A
B4B4 LD A,H Invert the high byte.
B4B5 CPL
B4B6 LD H,A
B4B7 INC HL Add one.
B4B8 RET Return.
View the equivalent code in;
Prev: B48E Up: Map Next: B4B9