ver 8.3 code placement in flash

Beta Testing discussion on mikroPascal.
Post Reply
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

ver 8.3 code placement in flash

#1 Post by janni » 11 Jul 2008 18:06

Hi mE team,

Is there some reason (other than aesthetic) that code is now placed in flash according to size, i.e. smaller procedures following bigger ones? Previous organisation with main at the end, and ISRs at the beginning of ROM, made more sense.

The assembly listing is now disorganised (or rather organised as always, just addresses do not follow it anymore) making it hard to use the org directive safely (it's next to impossible to follow changes in code organisation after some procedures are org'ed). The new code placement leads also to unexpected results - like two ISRs localised on opposite ends of flash.

Can we have the old code placement back, please? (Grouping by libraries and units would be ideal, but that's probably too much to ask :oops: .)

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: ver 8.3 code placement in flash

#2 Post by zristic » 14 Jul 2008 07:57

The new placement guarantees that less space will be wasted, i.e. the routines fit better.

As for the LST file, we will work on it to be organized better, I just added it to the wish list.

Thanks.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: ver 8.3 code placement in flash

#3 Post by janni » 14 Jul 2008 14:22

zristic wrote:The new placement guarantees that less space will be wasted, i.e. the routines fit better.
That could be true, at least for smaller PICs - provided linker places code fragments so that it minimizes page switching.
It shouldn't matter in PIC18s, though - if the linker can order routines from biggest to smallest, it can do it any other way, as well :) . I'd rather have it the old way, or, ideally, groupped by libs and units.

As for the smaller PICs - I've performed a test for GLCD example (EasyPIC5, PIC16F877A, same libs used for both compiler versions) and here are the results - rather contradicting your thesis :cry: .

Code: Select all

                    v 7                      v 8.3

ROM                 4393                     4546

page switching       116                      267
instructions
As you can see, the number of page switching instructions more than doubled in case of new code ordering :!:
Note also, that the increase in code size almost exactly fits the number of added page switching instructions so it's the sole reason of code bloating - with no visible savings due to new way of code placement.

Concluding, instead of lower ROM usage we have another source of code bloating (for smaller PICs) plus a mess in assembly presentation. Is it really worth the nice look in statistics window? Or am I missing some real reason the new code placement was introduced for?

Donald Shimoda
Posts: 553
Joined: 27 Feb 2006 17:00
Location: Argentina
Contact:

Re: ver 8.3 code placement in flash

#4 Post by Donald Shimoda » 21 Jul 2008 18:04

zristic wrote:The new placement guarantees that less space will be wasted, i.e. the routines fit better.

As for the LST file, we will work on it to be organized better, I just added it to the wish list.

Thanks.
Make it selecctable please. Let the user the chances to make that optimizations.
Donald Shimoda.

Post Reply

Return to “mikroPascal Beta Testing”