indirect addressing in PIC16

Status
Not open for further replies.

nitE

New Member
Failure Equ 0x30

movlw 0x30
movwf pointer

Incf pointer,f ;next address
movfw pointer
movwf FSR
movf INDF,w
movwf Failure

what i wanted to ask is if Failure points to the address position 0x30 and by using FSR and INDF after the instruction movwf Failure, does now Failure points to 0x31 or the value inside the location Failure(0x30) is 0x31

thanks
 
what i wanted to ask is if Failure points to the address position 0x30 and by using FSR and INDF after the instruction movwf Failure, does now Failure points to 0x31 or the value inside the location Failure(0x30) is 0x31

No. Neither.

Pointer is loaded with 0x30
Pointer in incremented to 0x31
FSR is set to 0x31
INDF is read into Failure

So Pointer = 0x31, Failure contains the value at address 0x31
 
Last edited:
No. Neither.

Pointer is loaded with 0x30
Pointer in incremented to 0x31
FSR is set to 0x31
INDF is read into Failure

So Pointer = 0x31, Failure contains the value at address 0x31

so if i change the intruction to

movlw 0x30
movwf pointer
movfw pointer
movwf FSR
movfw temp01
movwf INDF

the value of temp01 will be store in 0x30? is that right

similarly

movlw 0x30
movwf pointer
movfw pointer
movwf FSR
movfw INDF

means w will contain the value at 0x30?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…