Didn't find your answer? Ask the community — no account required.
G
Gary Kato
Which PIC16 is it?
S
Sylvain Munaut
movlw h'FF' movwf 0Ch movwf 0Dh loop: // Value probed here movf 0Ch, f btfsc STATUS, Z goto turnaround decf 0Ch, f goto loop
turnaround: movf 0Dh, f btfsc STATUS, Z goto exit movwf 0Ch decf 0Dh goto loop
If you place code at the "Value probed here" marker, you'll see the values
FFFF ... FF01 ... FF00 FEFF ... 0001 0000 exit
But do you really need it ? If it's to iterate a fixed number of time without using the counter value, you just need to adjust the constant. Using incfsz might be more efficient. Just place in 0C and 0D (0x10000 - number of iter).
clrf 0Ch clrf 0Dh loop: // Value probed here incfsz OCh goto loop incfsz 0Dh goto loop
Sylvain
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.