Prev: 41849 Up: Map Next: 41896
41886: Negate HL
Used by the routine at DrawLine.
Replaces HL with its two's complement (i.e. HL=0 - HL).
Input
HL The value
Output
HL The negated value
NegateHL 41886 PUSH DE Stash DE on the stack.
41887 EX DE,HL DE=HL.
41888 LD HL,0 HL=0.
41891 AND A Subtract the value.
41892 SBC HL,DE
41894 POP DE Restore DE from the stack.
41895 RET Return.
View the equivalent code in;
Prev: 41849 Up: Map Next: 41896