Hi,
What happens to that first 256 bytes?
Linker script and memory map
Address of section .data set to 0x800100
Thanks,
Alan
Hi,
What happens to that first 256 bytes?
Linker script and memory map
Address of section .data set to 0x800100
Thanks,
Alan
What happens to that first 256 bytes?Linker script and memory map
Address of section .data set to 0x800100
0x0000..0x001F registers R0 .. R31 0x0020..0x00FF SFRs (ADC, timer, SPI, etc. etc.) 0x0100..RAMEND SRAM memory
This is the memory map that the ST, LD, STS, LDS instructions "see" and operate upon.
The SBI/CBI/IN/OUT instructions "see" the early part of that 0x0020..0x00FF but with a -0x20 offset so they see their own 0x00..0x1F (SBI/CCBI) or 0x00..0x3F (IN/OUT).
When using gdb you can read 0x80003F (for example) to access SREG and so on. Or you could even use 0x800014 to access R20.
Hi,
I know in SRAM that the first 256 bytes are registers, is this why? Why would it affect flash?
Thanks,
Alan
.data is NOT in flash! it is in SRAM
Good point glitch! I'm trying to reconcile a file produced with this vs the flash used:
@"c:\program files\atmel\winavr\bin\avr-nm" -S --size-sort -tdec test.elf >scanelf.txt
00000190 00000006 T main
This is an empty project. A main() and nothing in it. It says 6 bytes for the main, but yet it is started at offset 190. What happened to that first 190 bytes?
What happened to that first 190 bytes?
PS: Try this
avr-objdump -d -h test.elf
Then you see in detail what it is used for.
Thanks Stefan, they certainly sheds some light on it!!!
Some words about the CRT here:
https://www.avrfreaks.net/index.p...
and (perhaps a better description) here:
Thanks clawson; those links are very informative!!
Yeah I keep meaning to make that into a Tutorial though at one stage Eric did ask that I add some words along those line to the AVR-LibC documentation.