Dear Gurus I don't get consistent div by 2 results using RRCF. or should it be RRNCF?
I attach the assembler code snippet
The example msb 43 3B 05 lsb div/2 should give an output of hex 21 9D 82 in the
temp3, temp2, temp1 registers.
This number does but others with F seem to produce rubbish div /2 results.
Obviously the code is precarious and I would appreciate comment on chaining registers to get consistent div/2 results.
Bye and thanks
Fred
In case the jpeg doesn't get through the code is:-
RRFtest:
clrf temp4
clrf temp3
clrf temp2
clrf temp1
movlw 0x43 ; Dummy infoMSB 0x43,0x3B,0x05
movwf temp3 ; to try and isolate the problem
movlw 0x3B
movwf temp2
movlw 0x05
movwf temp1
Divby2startshere:
rrcf temp3,f,1
btfsc STATUS,C
nop
nop
rrcf temp2,f,1
btfsc STATUS,C
nop
nop
rrcf temp1,f,1
nop
nop