robertkendrick
New Member
Hi
Try this simple code using FSR1 with andwf and iorwf instructions.
label one works. label two and three fail.
Wondering if anyone has had similar problems and knows of a fix.
Try this simple code using FSR1 with andwf and iorwf instructions.
label one works. label two and three fail.
Wondering if anyone has had similar problems and knows of a fix.
Code:
; 18F4520
; abnormal behaviour in PIC18 Simulator IDE
org 0
goto 0x100
org 0x100
one: ; works as defined
movlb 0
setf FSR1H
movlw 0x93
movwf FSR1L
movlw 0xee
movwf preinc1
two: ;this code snippet does not alter
;TRISC and corrupts TRISD. Also
;FSR1 is incremented twice.
movlw 0x93
movwf FSR1L
movlw 0x7f
andwf preinc1,f
three: ;this code snippet does not alter
;TRISC and corrupts TRISD. Also
;FSR1 is incremented twice.
movlw 0x93
movwf FSR1L
movlw 0x0f
iorwf preinc1,f
end