Initialized ram sections are dealt with by putting those variables into a section with a well-known name, ".data" IIRC. The linker script allocates space for that section in ram, and *also* space for that section in program flash. The C runtime contains code to block-copy that flash section into ram before entering main. If you want an initialized variable, you simply need to put it under a .section .data directive.
I presume you found this?
http://www.nongnu.org/avr-libc/user-manual/assembler.html
I think there are also some tutorials at avrfreaks.net.
The avrlibc doc linked above has basic information on how the avrgcc runtime and default linker scripts expect to have things laid out.
The avr-libc-dev mailing list:
AVR-li...@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
is probably a good place to ask questions about avr gas and avr gnu linker scripts. Yeah, it's a little off-topic for the list, but pretty much everybody who knows the straight scoop hangs out there and they are tolerant of intelligent questions regarding low-level avr gcc/gas/linker issues.
You may know this already, but just a reminder: gcc inline assembly is subject to optimizations such as code motion -- in particular, since CLI/SEI don't depend on the contents of registers, the optimizer likes to slide them around :-/
-dave
> --
> You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
> To post to this group, send email to hbrob...@googlegroups.com.
> To unsubscribe from this group, send email to hbrobotics+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hbrobotics?hl=en.
giuliano
On Aug 17, 2011, at 6:11 PM, Mike Thompson wrote: