Jump to content
Sign in to follow this  
SvendW

Main Function Without Endless Loop Is No Good!

Recommended Posts

Hej,

not that it matters very much, but BoostC 1.6 does generate a faulty PIC program IF THE main function does not contain an endless loop:

 

 

void main()

{

 

}

 

generates "stack underflow" under the simulator

 

but newbies may be allerted (like me) :)

 

Regards

SvendW

Share this post


Link to post
Share on other sites
:) Your "main" program must always loop, otherwise the PIC program counter will run past the bounds of the main program and execute code that is in the next program location. The reason for the stack overflow is probably due to hitting an instruction that pushes something and the stack and since it is only 8 entries deep it wouldn't take long to fill it up, since your program is running away out of control. :rolleyes:

Share this post


Link to post
Share on other sites

thanks andydavy, it was just a warning on how wrong it goes without an endless loop! ('cause we don't want BoostC to add a fix for this and waist memory for it!)

 

Regards

SvendW

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...
Sign in to follow this  

×
×
  • Create New...