The PIC18 push/pop instructions act only in the hardware call stack. For data stack access PIC18 doesn't have proper push/pop instructions, but the access through the FSRs PREINC1, POSTINC1, POSTDEC1 and INDF1 may be used to access the stack in the proper way. FSR1 is the register used by MPLAB-C18 as data stack pointer. Eg.: movwf POSTINC1,ACCESS =3D push WREG movff Var,POSTINC1,ACCESS =3D push Var pop is a little more complicated: movf POSTDEC1,f,ACCESS + movf INDF1,w,ACCESS =3D pop WREG For stack frame access, one must use the FSRs PLUSW2 and INDF2. FSR2 is used by MPLAB-C18 as frame pointer. Regards, Isaac Marcel Birthelmer escreveu: > Specifically, I was talking about an area of memory that is made available > also via stack instructions. push/pop is, strictly speaking, a hardware > stack, yes. But in the context of this discussion (C programming, frames > etc.), a stack is an area of memory that can be modified via stack-orient= ed > instructions (push/pop), directly as memory (lda, sta), and whose address= is > stored in a special register to facilitate the latter as part of a standa= rd > ABI. I'm sorry if I was unclear. > - Marcel > > On Sat, Jun 13, 2009 at 7:36 PM, Gerhard Fiedler = >> wrote: >> = > > = >> Olin Lathrop wrote: >> >> = >>> Marcel Birthelmer wrote: >>> = >>>> It doesn't have a proper HW stack, in the sense that other processors >>>> do >>>> = >>> It can do push and pop in single instruction cycles. I don't see >>> what else it would have to do to qualify for being a "hardware" >>> stack. >>> = >> In this context, size? This is in the context of C compilers and >> re-entrant functions, which typically means that all data is on the >> stack. This requires that besides the stack being a "hardware" stack, it >> also has a stack that can be adapted to the application's memory >> requirements. PIC18 hardware stacks typically can't be. That's probably >> the "sense" Marcel was talking about -- which someone programming in C >> probably would know :) >> >> Gerhard __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist