Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84 chuqui version 1.9 3/12/85; site unisoft.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!lll-crg!dual!unisoft!fnf From: fnf@unisoft.UUCP Newsgroups: net.emacs Subject: Re: GNU on Integrated Solutions Message-ID: <561@unisoft.UUCP> Date: Sun, 8-Sep-85 14:08:56 EDT Article-I.D.: unisoft.561 Posted: Sun Sep 8 14:08:56 1985 Date-Received: Tue, 10-Sep-85 04:07:12 EDT References: <34700009@ctvax> Reply-To: fnf@unisoft.UUCP (Fred Fish) Organization: UniSoft Systems, Berkeley Lines: 42 In article <34700009@ctvax> pedz@ctvax writes: > >3) alloca not only has the same problem on the IS as on the other >68000 systems but it has one much more serious problem. The IS >compiler does the link and then movm to save the registers. Thus when >the stack pointer is moved down, the registers are popped back off >with the movm get bad values from the alloca storage... Hmm, I don't know what the IS compiler is doing but both our 5.0 compiler (based on the mit port of the pcc) and our 5.2 compiler (the SGS from the generic 68000 microport), use the *frame pointer* with the link and movem instructions, not the *stack pointer*. Thus mucking with the stack pointer has no effect on subroutine linkages or register save/restores. Here is a copy of alloca.s that we use with our GNU emacs port under SVR2 on a dual systems machine. It seems to work fine. Whether or not it is correct is another matter :-). -Fred file "alloca.s" global alloca alloca: mov.l (%sp)+,%a1 # pop return addr from top of stack mov.l (%sp)+,%d0 # pop size in bytes from top of stack add.l &R%1,%d0 # round size up to long word and.l &-4,%d0 # mask out lower two bits of size sub.l %d0,%sp # allocate by moving stack pointer tst.b P%1(%sp) # stack probe to allocate pages mov.l %sp,%a0 # return pointer as pointer mov.l %sp,%d0 # return pointer as int to avoid disaster add.l &-4,%sp # new top of stack jmp (%a1) # not a normal return set S%1,64 # safety factor for C compiler scratch set R%1,3+S%1 # add to size for rounding set P%1,-132 # probe this far below current top of stack =========================================================================== Fred Fish UniSoft Systems Inc, 739 Allston Way, Berkeley, CA 94710 USA {ucbvax,dual}!unisoft!fnf (415) 644 1230 TWX 11 910 366-2145 ===========================================================================