Page 1 of 1

Compiled size

Posted: Mon Oct 02, 2017 9:25 am
by SHughes_Fusion
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)

Re: Compiled size

Posted: Mon Oct 02, 2017 11:33 am
by Jerry Messina
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.

Re: Compiled size

Posted: Mon Oct 02, 2017 11:57 am
by Jerry Messina
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.

Re: Compiled size

Posted: Mon Oct 02, 2017 1:26 pm
by SHughes_Fusion
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!