augustinetez
Active Member
I know there used to b a 16F to 18F migration document on the Microchip website at one stage, but I'm buggered if I can find anything on that site anymore.
So quick (dumb-ish) question - is RRCF in 18F asm the same as RRF in 16F asm?
Reading the datasheets seems to indicate it is, just want to make sure I'm not missing something.
As for why do I want to know - converting this to use in a 12F chip:-
So quick (dumb-ish) question - is RRCF in 18F asm the same as RRF in 16F asm?
Reading the datasheets seems to indicate it is, just want to make sure I'm not missing something.
As for why do I want to know - converting this to use in a 12F chip:-
Code:
16-bit random generator (tested)
The 0xA1 is part of a prime polynom value 0xA1A1 which generates a full LFSR
Random:
BCF STATUS,C
RRCF LFSRVALUEH,F
RRCF LFSRVALUEL,F
BTFSS STATUS,C
RETURN
MOVLW 0xA1
XORWF LFSRVALUEH
XORWF LFSRVALUEL
RETURN