Jump to content

Incorrect code generated from mixed C++ & inline assembler

Recommended Posts

Bug description:

Compiler generates incorrect code from mixed C++ and inline assembler -


Steps to reproduce:

The following is a sample section of code that generates the wrong address for _TestTemp+1 -

void CPUTest()
	unsigned char TestTemp[3];


            movlw   0xff                        ; set up locations ready to change
            movwf   _TestTemp
            movwf   _TestTemp+1
            movwf   _TestTemp+2				 
            lfsr    0, _TestTemp+1              ; set up a pointer
            movlw   0x55
            movwf   _postdec0

Expected behaviour:

In my application TestTemp[0] is located at 0x5C2, TestTemp[1] and [2] are at 0x5C3 and 0x5C4 respectively.
The compiler should load fsr0 with the value 0x5C3 (_TestTemp+1), however the final generated code loads the value 0x5C2 instead.


Is the problem 100% reproducible:

100% happens every time


IDE version:   MPLAB-X V4.20

Compiler:               BoostC++

Compiler version:     V7.43

Target device: PIC18F8527

OS:                      Win7




Link to post
Share on other sites



Confirmed, both for C++ and C.

Did you try to send an email to support@sourceboost.com ?


Best regards



Edited by JorgeF
Link to post
Share on other sites



Usualy the forums are more targeted at experience exchange between users than to technical support.

Same happens with the Microchip forum and a few others I know.


Best regards



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