Re: ELF R_AVR_13_PCREL Relocation

Dylan McKay <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <CAHAccTM=otSorauazeNCPrb=xUOnWNUBWL7RMcCP0Ur=VCHwsg@mail.gmail.com>
I think you just gave me an epiphany - is that because all AVR instructions
are 16-bits or 32-bits, so all instruction offsets must be even and an even
binary number always has a LSB of 0?

That would explain all of the right-shifts in `binutils`. So I take it that
the AVR core in its deep, dark, HDL cave, simply left shifts the offset
during the execute cycle? That way we save a bit in the instruction
encoding that was always going to be the same?

On Thu, Feb 19, 2015 at 3:59 PM, Jeff Barlow <[email protected]> wrote:

> On 02/18/2015 06:11 PM, Dylan McKay wrote:
>
>>
>> This relocation is solely for the relative `jmp` and `call` instructions
>> (if I'm not mistaken).
>>
>> Both of these instructions have exactly 12 bits for their target
>> address. Why is the relocation 13 bits then?
>>
>
> The resulting LSB of of those relocations is always zero, of course. The
> 12 bits in the instructions are bits 1 - 12. With the assumed zero LSB
> that's 13 bits total.
>
> --
> Later,
> Jeff
>
> _______________________________________________
> AVR-GCC-list mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>

_______________________________________________
AVR-GCC-list mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.