I have run into a snag in my brain. Here is the ASM:
Now I understand what it is doing, but I don't get why. The first line shifts ABTIME right 1 bit. This also clears bit 7. Because RRF rotates through the carry bit, ABTIME.0 gets put into the carry flag. So what is happening is this:Code:rrf ABTIME,W ; B0 btfss STATUS,C ; Rounding ; B0 addlw 0xFF
Shift right 1 bit
If the original (before shift) ABTIME.0=0 then add $FF to ABTIME. this seems to just clear the new ABTIME.0
So why not just do this:
I guess my problem is did I evaluate what they are doing correctly?Code:tempflag = ABTIME.0 ABTIME = ABTIME >>1 IF TEMPFLAG THEN ABTIME.0 = 0




Bookmarks