As far as I know, if you implement PIC using rjmp, then your PIC will be limited to 4K because rjmp accepts 12 bit operand.
--- On Wed, 5/21/08, Moritz Struebe <address@hidden> wrote:
From: Moritz Struebe <address@hidden>
Subject: [avr-gcc-list] Position Independent Code / Data (PIC /PID)
To: "avr-gcc-list" <address@hidden>
Date: Wednesday, May 21, 2008, 7:54 AM
I already posted this to avr-libc, but I didn't get an answer jet and it
probably was the wrong group.
I developed module support for Nut/OS running on a ATmega128. At the
moment I allocate memory and then link against this information. Using
PIC would save me this trouble.
I did some research on PIC/PID & AVR, but mostly found guesswork and/or
even false information. (Or people complaining that someone posted in an
AVR and not in the Microchip-Forum. ;-) )
Dunkels et al. say that PIC is limited
to 4K . I'm not sure why this
is the case. Looking at the documentation I come up with +-2^16 words =
I'm also not sure how to interpret the -mshort-calls option. Does this
mean I get only rjmps and the linker will complain if the jumps get too
long, or will the Linker silently fail.
Further on I curious whether it would be (theoretically) possible to let
the linker decide whether to use jmp or rjmp or even do double rjmps to
cover the full range. I know, the latter is a bit strange, but would
enable code > 64K to be position independent.
I was wondering whether PID is supported because it came up in one or
two threads. But I assume not.
Thanks for your advice.
AVR-GCC-list mailing list