avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] debugging gdb/ddd: wrong assembler output with offset 0x8


From: Mitch Davis
Subject: Re: [avr-chat] debugging gdb/ddd: wrong assembler output with offset 0x800000
Date: Wed, 14 Dec 2011 16:47:08 +0800

On Wed, Dec 14, 2011 at 4:14 PM, Klaus Rudolph <address@hidden> wrote:
>
> The assembler output now has an offset of 0x800000 ?????
> Why?
>
> looks fine. But the assembler window has still the offset to 0x800000.

The x86 is a von-Neumann architecture: There is one address space,
which contains both code and data.

The AVR is a Harvard architecture: The address spaces for code and
data are separate.  Usually, data is in SRAM, but it can also be in
flash ROM.

The GNU toolchain's way of handling these two address spaces is to add
0x800000 to addresses which are in SRAM.

You can read about it here:

  http://linux.die.net/man/3/mem_sections

Another thing to watch out for: Sometimes with the AVR, addresses are
in terms of bytes, and sometimes in terms of 16-bit words.  Sometimes
you have to guess which one the GNU toolchain wants.

Mitch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]