diffs to get gcc-1.22 running on unix pc

Mike "Ford" Ditto ford at elgar.UUCP
Thu Jun 23 03:41:23 AEST 1988


In article <743 at naucse.UUCP> rrr at naucse.UUCP (Bob Rose ) writes:
>alloca:
> [ ... ]
>	tst.b	P%1(%sp)	# stack probe to allocate pages

That is the alloca from emacs, which has some extra code to handle
some peculiarities of various 68000 systems.  Here is my version,
optimized for the Unix PC:

	global	alloca
alloca:
	mov.l	(%sp)+,%a0	# pop return addr
	mov.l	(%sp),%d0	# get size argument
	and.l	&-4,%d0		# round size down to long word
	sub.l	%d0,%sp		# allocate by moving stack pointer
	mov.l	%sp,%d0		# return pointer in d0
	lea	-4(%sp),%sp	# allow caller to pop the arg
	jmp	(%a0)		# return

It tries to keep things longword aligned, even though the 68010 only
needs word alignment, but it's good for 68020's that way.


					-=] Ford [=-

"Once there were parking lots,		(In Real Life:  Mike Ditto)
now it's a peaceful oasis.		ford at kenobi.cts.com
This was a Pizza Hut,			...!sdcsvax!crash!kenobi!ford
now it's all covered with daisies." -- Talking Heads



More information about the Comp.sys.att mailing list