Jump to content

Recommended Posts

I have encountered a problem using the assembler within BoostC. I am trying to translate a Microchip assembler program to C, but wish to leave some parts as assembler, using the asm{} feature. This works fine, apart from one instruction, which BoostC flags as "unknown identifier" The identifier is a label in the assembly code, referencing a code memory address; this is then used with the movlw instruction within the same section, thus:

 

TRFReset:

......

......

movlw TRFReset

 

and it is this last instruction that gives the error. I'm assuming the syntax is correct, and it is the BoostC assembler that is problematic? Although I'm not convinced that as given it is correct. 'W' is an 8-bit register and the full address referenced by the label is 13 bits, so am I missing something here? Incidentally, the address is used to modify the program counter for entry into a jump table.

Any suggestions would be most welcome. :(

 

 

Share this post


Link to post
Share on other sites

Labels can't be used as arguments of movlw and similar instructions. The reason behind is that compiler does not know where linker will place the code and thus can't generate literal to use with the instruction.

 

Regards,

Pavel

Share this post


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.

Guest
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.

Loading...

×
×
  • Create New...