One thing to be careful about if your segments are large is that the 16 bits 
used for relative branching is a *signed* value, meaning that you can jump +/- 
32K bytes from the current location. This in turn means that an instruction 
near the end of a 64K segment still can't branch to an instruction near the 
beginning of the segment if the two instructions are more than 32K bytes apart, 
even though they're in the same segment.

If you keep your segments to no more than 32K bytes total, then you will always 
be safe. And inter-segment branches are done with "long" 32-bit direct jumps.

A lot of the reasons for this architecture goes back to the days when memory 
was expensive and many devices were sizes in terms of kilobytes of memory -- 
not megabytes. These days the newer processors usually don't bother trying to 
save a few bytes here and there in their instructions sets.
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to