Jump to content

Boostc_Pic16.exe Infinite Loop

Recommended Posts

Bug description:

The compiler goes into an infinite loop.


Example code:

#include <system.h>

typedef unsigned char uint8;

#define asmref(thing)  _##thing
#define PORTOF(thing)  ((thing)>>4)
#define PINOF(thing)  ((thing)&0xF)
#define LED1_PIN  0xA0

inline void bug(uint8& values)
 asm //use asm block to prevent dead code removal
     goto return2caller;
;//  setbit_asm(asmref(values), LED1_PIN, FALSE); //turn bit off
	 bcf asmref(values)+PORTOF(LED1_PIN), PINOF(LED1_PIN);
	 goto return2caller;

uint8 var1[10];

void main(void)


The example above is a simple function, but the problem is occurring in a much larger program that I have.

I assume that macros are allowed within asm blocks, since it is still the preprocessor at that point. I didn't see anything in the documentation that it was not allowed.


Expected behavior:

Preprocessor should expand the macros and then the compiler should generate the appropriate instructions for the example code.


Is the problem 100% reproduceable:






Compiler version:



Target device:

PIC16F1827, etc.



Windows XP




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