CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Calling a C function in the assembly?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Kilrah
Guest







Calling a C function in the assembly?
PostPosted: Sat Feb 25, 2006 4:04 pm     Reply with quote

Hello,

I have a little question... I'm currently writing a program on a PIC12F675. The program core is now working... but with 98% of used ROM, and some features are still missing.
I've seen I could save a lot of space on some comparisons if I wrote them in ASM, but there are function calls in there. Is it possible to call a C function from the ASM, give it its parameter and get the return value back?
That is provided I'm very short on RAM space as well, so would like to avoid extra vars.

Thanks,
Kilrah
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 25, 2006 11:48 pm     Reply with quote

Before you do that, it's advisable to go through your code and
try to reduce ROM usage by re-writing portions of it.
This thread from the old board explains how to do this:
http://www.pic-c.com/forum/old/messages/1777.html
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 26, 2006 3:35 am     Reply with quote

Another way the increase your ROM is to use the 12F683, It is pined the same as the 12F675 with double the ROM, RAM etc. otherwise, try rewirting your code in a different way to make it smaller.

Andrew
_________________
What has been learnt if you make the same mistake? Wink
sonicdeejay



Joined: 20 Dec 2005
Posts: 112

View user's profile Send private message

PostPosted: Sun Feb 26, 2006 4:23 am     Reply with quote

check it out....

http://ccsinfo.com/forum/viewtopic.php?t=25805&postdays=0&postorder=asc&start=15&sid=f6f92a930c1109f91a13399c4eef2d9a

Smile
Guest








PostPosted: Mon Mar 06, 2006 1:47 pm     Reply with quote

Hmm, replying a bit late, I've been busy lately.

Thanks for the answers. The 12F683 seems a very nice alternative. Unfortunately I already bought a stock of 12F675s a while ago, before it existed, so I'll have to use these... :(

But I'll sure to order them next time, the 8MHz internal RC sounds good too ;)

I had already done the LST file check. Unfortunately a lot of the space is used by the software i2c routines that are the base of the application. But the compiler routines are way too complete for my use.

Anyway, I've nearly finished rewriting the software in assembly. I'm using around 43% of code space for the same functionality. That will leave me with enough space for everything for sure.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group