Compiled size

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Compiled size

Post by SHughes_Fusion » Mon Oct 02, 2017 9:25 am

Quick question - does the compiled size shown in the IDE include the reset and interrupt vectors?

I'm writing a bootloader for the 14K22 which has options of 1K and 2K boot block sizes. The code is compiling to 1003 bytes, if this includes the vectors then it fits in the smaller bootblock, if it doesn't then my calculations suggest I need to get the size to under 992 bytes - is that right? (Or change to the 2k block size)

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Compiled size

Post by Jerry Messina » Mon Oct 02, 2017 11:33 am

I haven't looked at this for a while, but from what I remember the "program bytes used" display in the IDE is purely a count of the number of bytes and doesn't take into account the locations. It even includes a count of the CONFIG bytes, which shouldn't really go against the max number of bytes in the program space for most chips (except for the J series).

When I'm doing a bootloader I usually just look at the hex file to make sure things are as I expected and there are no surprises.
I toss a "#variable _maxrom = BOOT_BLOCK_SIZE" into the source and if it starts complaining I know I need to take a look.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Compiled size

Post by Jerry Messina » Mon Oct 02, 2017 11:57 am

Here's a handy hex file display utility I found years ago. It shows the different regions of the hex file and their contents.

I think the website I got it from is now defunct, so I imagine it's ok to post.
Attachments
HexLister.zip
(266.75 KiB) Downloaded 174 times

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Compiled size

Post by SHughes_Fusion » Mon Oct 02, 2017 1:26 pm

Good call, Jerry, I didn't think of that approach. The highest location in the hex file is 03E0 so it appears it's within the 1k boundary - just!

Post Reply