From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] bug in asm.ps From: Brantley Coile Date: Mon, 6 Mar 2006 10:36:10 -0500 In-Reply-To: <599f06db0603060731w45549c3bw64296d1f17379498@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 0bb0d7ba-ead1-11e9-9d60-3106f5b1d025 Oh, I understand now. You are correct. Asm.ps is wrong. > Ok, but what I meant is that the automatics are upside down growing from n > to 0 as the memory grows. Of course if you call any functions, the SP points > to the last space left for their arguments. As far as I understand if you dont > call any functions, 0(SP) is the last automatic. If you dont have any > automatics, SP points to the return PC. If you call any functions there is space > for their args (probably for the args of the functions with the > biggest number of args) and SP is pointing to the last space which > will be the first arg, because > they gro from 0 to n as the memory grows. > > On 3/6/06, Brantley Coile wrote: >> SP doesn't point to the last automatic on the stack. >> Not only is the automatics on the local stack, but also >> temporaries, like the ones to hold parameters to a function. >> If you call any functions 4(SP) is the second parameter to functions. >> >>