Jump to content

Recommended Posts

Hi,

 

I have trouble compiling with embedded assembler code. It appears like only a subset of the assembler instructions is supported. Is this so or am I doing something wrong? If not all instructions are supported, is there any documentaion of what is/is not supported? Here is an example that does not compile (for PIC16F876):

 

asm
{
 movlw 5
 movwf _test
 movf  _test, W
 rlf   _test, F
}

The first two lines (movlw and movwf) compile fine. The last two lines (movf and rlf) give me an error (as usual in BosctC without the slightest hint of what is actually wrong).

 

Thanks for any help.

Edited by techie
Link to post
Share on other sites

Works for me using BoostC 6.89 PIC16F876

 

unsigned char test;
asm
{
 movlw 5
0008  3005	  MOVLW 0x05

 movwf _test
0009  1283	  BCF STATUS, RP0
000A  00A0	  MOVWF myFunc_00000_1_test

 movf  _test, W
000B  0820	  MOVF myFunc_00000_1_test, W

 rlf   _test, F
000C  0DA0	  RLF myFunc_00000_1_test, F

}

 

I have seen problems in the past with instructions end in ,W and ,F. Adding a semicolon to the end of the line appeared to solve it.

 

Sure your BoostC version is up to date and your target is correct ?

 

Cheers

 

Reynard

Link to post
Share on other sites
I have trouble compiling with embedded assembler code. It appears like only a subset of the assembler instructions is supported. Is this so or am I doing something wrong? If not all instructions are supported, is there any documentaion of what is/is not supported? Here is an example that does not compile (for PIC16F876):

 

asm
{
 movlw 5
 movwf _test
 movf  _test, W
 rlf   _test, F
}

The first two lines (movlw and movwf) compile fine. The last two lines (movf and rlf) give me an error (as usual in BosctC without the slightest hint of what is actually wrong)..

Make sure you #include <system.h> for definitions of W and F registers.

 

Regards

Dave

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