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 CCS Technical Support

weird compiled code question

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



Joined: 19 Jan 2005
Posts: 8

View user's profile Send private message

weird compiled code question
PostPosted: Tue Jan 25, 2005 12:48 am     Reply with quote

Hi to all.
I am seeing something weird in my program memory after I compile my code. After I have compiled my C code , if I look at the compiled code in the View - Program Memory in Mplab I see something strange.
The program memory if filled from 0 to about 0589 with normal code. Then from 058a to 07FF is 0x3fff(blank) and the code then carries on untill
0CFF normally. The code runs with no problem , I am just wondering about this "Gap" in the program memory.
I seems to be caused by using the printf function when printing a floating point number to the lcd. eg : printf(lcd_putc,"%3.1F ",maxlogtemp / conversion_factor);
If I don't print any floats the code compiles in one continous block.

Any Ideas.
Cheers
Rob
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 25, 2005 1:11 am     Reply with quote

The reason is that your PIC has two or more ROM pages, each being
0x800 words in length. The compiler will not locate a function so that it
spans a ROM page boundary. Each function must fit entirely within a
page. Functions that use floating point tend to be large, so apparently
the compiler couldn't fit your function into the remaining space in the
1st page, so it moved to the 2nd page.
seegoon



Joined: 19 Jan 2005
Posts: 8

View user's profile Send private message

PostPosted: Tue Jan 25, 2005 1:20 am     Reply with quote

Makes sense.
Thanks
Rob.
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