[Top][All Lists]

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

Re: [avr-gcc-list] Absolute Sections / Assembly

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Absolute Sections / Assembly
Date: Wed, 9 Jul 2003 22:20:34 +0200 (MET DST)

In article <address@hidden> you write:

>I have an array of data I want in a specific memory location in
>program memory.

Strange, it seems to work for me.


.section        .mydata
.global mydata
.byte   8, 9, 10, 1, 2, 3


extern unsigned char mydata[];

        int *mydatap = (int *)mydata;
        return *mydatap;

avr-gcc -O -mmcu=atmega128 -Wl,--section-start=.mydata=0x8000 -o foo foo.s bar.c

avr-nm -n foo says:

000000ca T main
000000de t __stop_program
000000de T _exit
000000de W exit
000000e0 A __data_load_end
000000e0 A __data_load_start
000000e0 T _etext
000010ff W __stack
00008000 ? mydata
00008006 ? endmydata

avr-objdump -d foo

000000ca <main>:
  ca:   cf ef           ldi     r28, 0xFF       ; 255
  cc:   d0 e1           ldi     r29, 0x10       ; 16
  ce:   de bf           out     0x3e, r29       ; 62
  d0:   cd bf           out     0x3d, r28       ; 61
  d2:   80 91 00 80     lds     r24, 0x8000
  d6:   90 91 01 80     lds     r25, 0x8001
  da:   0c 94 6f 00     jmp     0xde

000000de <_exit>:
  de:   ff cf           rjmp    .-2             ; 0xde
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

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