Yes, PalmOS uses a signed word as its jump offset.  That means from any
given point, you can jump forward up to 32k, or backward up to 32k.

If you have a very large project, you will get to the point where adding any
function might give you a whole bunch of really strange compile/link errors.
To fix this, you'll have to go play with the order your .c files sit in your
various code segments.  In Codewarrior, this is done in the Project window's
'Segments' tab.  See "Change the link order of the application," in the
_Targeting Palm OS_ document.

In Codewarrior land, with Smart Model, the linker will see if the function
is in the same code segment.  If so, it uses relative addressing, which is a
16-bit addr.  If not, it will use an absolute (32-bit) address.  The large
model will use 32-bit addresses for ALL function calls, regardless of where
they are.  Again, this is in Codewarrior land, not in Palm OS land.

So from that, I can only say the jump table of a large-model project will
always be as large as, or larger than, the jump table of a smart-model
project.

In PalmOS land, though, _Targeting the Palm OS_ states that "Due to the
design of Palm OS, applications can only makes jumps of 32k (16 bits)."
(page 22)  It then says one way to try and get rid of the "16-bit reference
out of range" build errors is to use the smart code model.  I don't know too
much about how multisegment jumps work, but I suspect they're limited to 32k
offsets on the actual device.  I think using the smart code model might
spare you some 16-bit reference build errors if you're targeting the
emulator, but I get the impression that Codewarrior is only fond of 16-bit
jumps.

Good luck!
-Jeff Ishaq
The Windward Group

>-----Original Message-----
>From: Douglas Corarito [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 09, 1999 4:05 AM
>To: [EMAIL PROTECTED]
>Subject: Jump Table Size?
>
>
>Does the Smart/Large Code model effect the jump table size?  
>Parts of my
>(very large) application are going off the deep end.  If I move the
>segments around, things work better.
>
>Are we limited to a 32K jump table (16 bit A5 offset)?
>
>
>Douglas Corarito
>mailto:[EMAIL PROTECTED]
>http://www.infoequipt.com
>
>INFOequipt
>P.O. Box 299
>Rowe, MA 01367
>(413) 339-0120
>FAX: (413) 339-4902
>

Reply via email to