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

PUTS limitations?

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







PUTS limitations?
PostPosted: Mon Apr 28, 2003 9:53 am     Reply with quote

<font face="Courier New" size=-1>The following is a set of help messages I want to send out in response to a user query. On the 16C58A address 0600 - 07FF is the last segment of ROM and is empty except for this function. I can send any 3 or 4 lines but if I uncomment more than that I get "OUT of ROM" even though there is lots of space in the segment. Why? Using #seperate instead of #org produces about the same result. I am using PCB 3.110.

#org 0x0600
SendHelp() { //Spew help messages
puts("Fxxxxx<cr> sets frequency to xxxxx Hz");
// puts("Bxxxxx<cr> sets burst length to xxxxx microseconds");
// puts("Dxxxxx<cr> sets Responder delay in microseconds");
// puts("P1<cr> to enable 1pps pinger mode");
puts("P0<cr> to disable pinger mode");
// puts("Only frequencies between 25kHz and 30kHz supported");
// puts("due to transducer limitations");
puts(__TIME__ __DATE__);
Verbose = false;
}

Segment Used Free
--------- ---- ----
0000-01FF 360 149
0200-03FF 406 90
0400-05FF 214 281
0600-07FF 74 426

Thanks,
</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 14026
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: PUTS limitations?
PostPosted: Mon Apr 28, 2003 12:04 pm     Reply with quote

:=The following is a set of help messages I want to send out in response to a user query. On the 16C58A address 0600 - 07FF is the last segment of ROM and is empty except for this function. I can send any 3 or 4 lines but if I uncomment more than that I get "OUT of ROM" even though there is lots of space in the segment. Why? Using #separate instead of #org produces about the same result. I am using PCB 3.110.
----------------------------------------------------------
I don't have PCB, but I took your code and compiled it for
a 16C558, which is very similar to a 16C58 -- only it works
with PCM. It compiled OK. I installed PCM vs. 3.110 for
that test.

What happens if you don't #org the function ?
The .LST file shows that if you #org it, the compiler always
generates a CALL to the function. At least, it does this with
PCM. I know that your PIC only has two stack levels, and this
might be the cause of the problem.
___________________________
This message was ported from CCS's old forum
Original Post ID: 14030
Sherpa Doug
Guest







Re: PUTS limitations?
PostPosted: Mon Apr 28, 2003 1:47 pm     Reply with quote

:=:=The following is a set of help messages I want to send out in response to a user query. On the 16C58A address 0600 - 07FF is the last segment of ROM and is empty except for this function. I can send any 3 or 4 lines but if I uncomment more than that I get "OUT of ROM" even though there is lots of space in the segment. Why? Using #separate instead of #org produces about the same result. I am using PCB 3.110.
:=----------------------------------------------------------
:=I don't have PCB, but I took your code and compiled it for
:=a 16C558, which is very similar to a 16C58 -- only it works
:=with PCM. It compiled OK. I installed PCM vs. 3.110 for
:=that test.
:=
:=What happens if you don't #org the function ?
:=The .LST file shows that if you #org it, the compiler always
:=generates a CALL to the function. At least, it does this with
:=PCM. I know that your PIC only has two stack levels, and this
:=might be the cause of the problem.

Since it is only called once the compiler tries to inline it if I don't use #separate or #org, and main() uses most of that segment so I get "Out of ROM". The functions have to be called from main() because of the stack limit.

I tried dividing the puts's into three functions but I get the same result.

#separate
SendHelp1() { //Spew help messages
puts("Fxxxxx<cr> sets frequency to xxxxx Hz");
puts("Bxxxxx<cr> sets burst length to xxxxx microseconds");
puts("Dxxxxx<cr> sets Responder delay in microseconds");
}
#separate
SendHelp2() { //Spew help messages
puts("P1<cr> to enable 1pps pinger mode");
puts("P0<cr> to disable pinger mode");
puts("Only frequencies between 25kHz and 30kHz supported");
}
#separate
SendHelp3() { //Spew help messages
puts("due to transducer limitations");
puts(__TIME__ __DATE__);
Verbose = false;
}//SendHelp


___________________________
This message was ported from CCS's old forum
Original Post ID: 14032
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