Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top