Jump to content
Sign in to follow this  
djulien

Wrong Opcode Generated

Recommended Posts

Bug description:

The wrong opcode is being generated. (no errors are being reported)

 

#include "<system.h>"

typedef unsigned char uint8;

//define an inline function so multiple asm can be used within macros:
inline void ADDLW(uint8& value)
{
asm addlw _value; //generates a movlw instead of addlw
}

void main(void)
{
uint8 var @0x300 + 12; //kludge: create var with desired value as its address so it can be passed by reference to inline function

ADDLW(var); //should generate "addlw 12", but generates "movlw 12" instead
}

 

Expected behavior:

The example code above should generate "addlw 12", not "movlw 12".

 

Is the problem 100% reproduceable:

yes

 

Compiler:

BoostC

 

Compiler version:

7.10

 

Target device:PIC16F1827, '1823, '688, etc.

 

OS:

Windows XP

 

don

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
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...
Sign in to follow this  

×