|
From: Marcin C. <sa...@sa...> - 2010-08-29 00:16:52
|
On Sun, 29 Aug 2010, pito wrote: > Marcin, when I do .s I see an address higher then 16383 (16557). So > it is an indication for me something must be wrong there. Matthias > sent the .s definition, from what I can see is he prints out the > address (of RAM - I do assume - when talking data stack), and as I > have shown the number is 16557.. So outside the RAM space. Maybe I > am mistaken.. Just explain to me plz.. Assembly listing of what, > please? P. Please see m1264Pdef.inc file in your AVRASM directory: ---8<------------------------------ .equ SRAM_START = 0x0100 .equ SRAM_SIZE = 16384 .equ RAMEND = 0x40ff .equ XRAMEND = 0x0000 ---8<------------------------------ RAM begins at $0100 and ends at $40ff. So you have in your listing: 00002a ff 40 .dw rstackstart ; USER_RP^M 00002c af 40 .dw stackstart ; USER_SP0^M 00002e af 40 .dw stackstart ; USER_SP^M Your return stack starts at $40ff and grows down and your data stack starts at $40af and grows down. Most ATmegas have stack at $0100, but some AVR CPUs have it at $0040, $0060 or $0200. My ATmega164P has RAM from $0100 until $08ff, so my rstack starts at $08ff and my data stack grows down from $08af. Hope it helps! --Marcin |