Hi, I have a question about abtaining the absolute value. I want to substract a 1 16bit values from eachother, but when the result is negative, set a bit and get the absolute value of the difference. I thought of the following, but that doesn't seem to work: ... ldi direction, 0 ; Substract values sub moveL, curPosL sbc moveH, curPosH ; If result positive, ok brcc PM1 ; Result negative, take absolute value and set flag neg moveL neg moveH ldi direction, 1 PM1: Any hints? Regards and best wishes for 2005 to all, Geert
Message
newbie absolute value
2005-01-02 by Geert De Pecker