Jump to content

Addfsr Fsr1, 0x04 ; Inline Assember

Recommended Posts



I have found a sourceboost error in version 7.01. with the PIC16F1824


I am using the following inline assember code.


movlw _Key ;

movwf _fsr0 ;

movwf _fsr1 ;

addfsr FSR1,4 ;


Normally FSR0 should be address of _Key and FSR1 should be address of _Key + 4 but addfsr does not work correct.


The above code is compiled to:


01F7 0084 MOVWF gbl_fsr0

01F8 0086 MOVWF gbl_fsr1

01F9 3100 ADDFSR 0, 0x00 <-------------- This is wrong it should be opcode 3144 !!


The compiler makes an error with ADDFSR instruction.


I also found that the compiler makes an error with the moviw FSR0++ instruction since:


moviw FSR0++ ;

moviw FSR1++ ;


are resulting in both a change of FSR0 register and not one increment on FSR0 and one increment on FSR1 as expected.


The following instructions don't compile or with an error.



Edited by PaulHolland
Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...