I am programming a DSPIC33FJ32MC304 and am trying to understand how much space my program uses in ROM. In my listing I find the following numbers:
ROM used: 4978 bytes (22%)
Largest free fragment is 12282
The listing starts at address 0x0000 and ends at 0x0B8E.
I have two questions about those numbers:
- Why does it say 22% of ROM used when 4978 bytes of 32768 bytes is only 15%?
- Why does it say 4978 bytes used when the program ends at 0x0B8E (=2968)?
Ttelmah
Joined: 11 Mar 2010 Posts: 19359
Posted: Fri Jul 01, 2016 3:15 am
The chip doesn't actually have 32K of usable program memory....
You have to look at the diagrams in section 4 of the data sheet. Though there is 32K or ROM in the program space, a large slice of this is for 'fixed' functions and can't be used by general code. So (for instance) the area up to 0x1FE in the ROM, is reserved for the interrupt vector table etc.. You get '11264 instructions' in the user program space (22528 bytes). 4978/22528 = 22.09%.
Then there is a huge amount of code not visible in your 'program'. Unless you 'rem' out the #nolist option (in the device file), all the code generated for the core library functions, won't be visible in the lst file (basically CCS default to showing the code generated by _your_ program, not their stuff). So there is a lot beyond 0xB8E.....
arnadan
Joined: 11 Nov 2013 Posts: 13
Posted: Fri Jul 01, 2016 7:20 am
Thanks Ttelmah for the detailed explanations. All clear to me now.
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