Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Structure alignment in Manx C Message-ID: <8802171829.AA10038@cory.Berkeley.EDU> Date: 17 Feb 88 18:29:33 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 15 :In article <8802160646.AA14996@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes: :> ptr = salloc(bytes) (allocates on a longword boundry) :> spop() pops the allocated stack frame, must :> call before return statement / end of :> subroutine. : : Actually, spop() isn't needed before an exit at all. Lattice :(and I'm fairly sure Manx) use the unlink instruction, which will restore :the old stack pointer. The only thing to watch out for is stack overflow. Yes, they do use LINK/UNLK, but they also use MOVEM REGS,-(SP) to save registers, and before the RTS do a MOVEM (SP)+,REGS. If the SP isn't in the right place, a bogus set of registers will be restored. -Matt