"Steve Jackson" <[EMAIL PROTECTED]> wrote in message
news:13502@palm-dev-forum...
> SMALL MODEL
> -----------
> - All jumps are "short" (16-bit direct). Applies to both intra-segment and
> inter-segment calls.
I think inter-segment jumps are always long, even if the Small code model is
used.
> SMART MODEL
> -----------
> - All intra-segment jumps are "short" (16-bit direct).
> - All inter-segment jumps are "long" (indirect, multiple 16-bit).
I think some intra-segment jumps are long. The compiler doesn't assume that
the segments are <32K, so if it hasn't compiled the destination yet, it will
use a long jump. So forward jumps are long. The exception is intra-function
jumps for branches and loops. The compiler assumes each function will be
<32K, so it uses short jumps within a function.
> LARGE MODEL
> -----------
> - All jumps are "long"
Yes.
> - Advice: Use SMALL model when your app is less than 32K.
I recommend using the Small code model, even for large apps, unless you have
a segment that you just can't squeeze down to 32K (or a bit more). In this
case, use the Smart code model. Use the Large code model for debug builds.
There are several reasons why you might have difficulty squeezing all your
segments down to <32K. You might have a lot of code that has to be in the
first segment. You might have your code organized into files based on your
design rather than segmentation. One technique I've used is to create
FooSeg1.c and FooSegN.c files.
As always, YMMV.
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/