if instead of 10k code written directly, I write a function and call that from option 1 ?

----- Original Message ----- From: "Aaron Ardiri" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Wednesday, February 15, 2006 7:20 PM
Subject: Re: Assembler Error: Value of -35828 too large for field of 2 bytes


Who knows what that means? I avoided the errors by adding a "-O1".
But how come?

this error occurred due to the size of the code.

if you have a function thats greater than 32kb, chances are that you
may have a switch statement that has a large amount of code inside it.
all jumps in 68k are done using 16bit values - so, you are limited to
jumping + and - 32767 bytes.

if you have this:

switch ()
{
 case 1:
           // 10K of code
 case 2:
           // 20K of code
 case 3:
           // 10K of code
 case 4:
          // 10K of code


jumping to case 1,2, and 3 will be fine, its offsets are 0, 10K and 30K. but,
case 4 is 40K away - this exceeds the normal jump boundaries = your error.
you didn't get the error with -O1 as it then optimizes for size = smaller code.

the fix? make your routines smaller so that there are no large branches like
this for the compiler to trip up on. everyone else's response should be
ignored - trust me, this is the error and reason.

--
// Aaron Ardiri

--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to