|
From: pito <pi...@vo...> - 2010-08-29 00:31:30
|
Marcin, MY BIG THANKS!! I simply thought the RAM ends at 0x4000.. So 0x40af = 16559 what is aproximately the magic number 16557 !!! Thanks again and sorry for my spaming the list.. Good night, Pito. ----- PŮVODNÍ ZPRÁVA ----- Od: "Marcin Cieslak" <sa...@sa...> Komu: "pito" <pi...@vo...> Předmět: Re: [Amforth-devel] .s on 1284p Datum: 29.8.2010 - 2:16:44 > 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 |