Jump to content
Sign in to follow this  
bsane

_startup Bug

Recommended Posts

I'm using BoostC 2.2.

 

Problem:

When _startup crosses a page boundary PCLATH doesn't get set correctly.

 

Example:

	ORG 0x000007E2
07E2        _startup
07E2  01FF 	 CLRF gbl_rxRead
.
.
.
080F  01FF 	 CLRF gbl_rxWrite
0810  2FB0 	 GOTO	main
ORG 0x00000811

 

 

 

Example code with _startup just after boundary:

	ORG 0x00000821
0821        _startup
0821  01FF 	 CLRF gbl_rxRead
.
.
.
084E  01FF 	 CLRF gbl_rxWrite
084F  118A 	 BCF PCLATH,3
0850  2FAA 	 GOTO	main

 

The work around I'm using is to pad main() so that _startup doesn't cross the boundary.

Share this post


Link to post
Share on other sites

bsane,

 

Nice one.

Startup code now assumes that PCLATH is unknown on entry, so PCLATH get correctly set.

 

This will be in the next release.

 

Regards

Dave

Share this post


Link to post
Share on other sites

bsane,

 

If you could supply a project that demonstrates the problem it would be appreciated. I'm trying to make the bad code with the current compiler/linker version (to add to our test suite) and I can't make the it fail.

 

Regards

Dave

Share this post


Link to post
Share on other sites
bsane,

 

If you could supply a project that demonstrates the problem it would be appreciated. I'm trying to make the bad code with the current compiler/linker version (to add to our test suite) and I can't make the it fail.

 

Regards

Dave

 

 

Sorry for the long delay... I've been out of town. I have a project that should generate the bug, let me know if you want it, and where I should send it.

 

Of course I no longer see the bug with the latest version :)

Share this post


Link to post
Share on other sites

bsane,

 

If you have a project than used to exhibit the problem I'm still interested.

I want to make sure that the problem is nailed for good.

 

Please send to support@picant.com.

 

Thanks

 

Regards

Dave

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  

×