From: matumura@kitune.ec.t.kanazawa-u.ac.jp (Tomomi Matsumura)
Newsgroups: fj.sys.x68000
Subject: gcc's code part2
Date: 28 Aug 92 07:12:35 GMT
Distribution: fj
Organization: Kanazawa University Faculty of Technology, Kanazawa Japan
Originator: matumura@kitune


$B>>B<CN8J!w6bBtBg$G$9!#(B

gcc$B%3%s%Q%$%k7k2L$K0[>o$J=PNO$,$"$C$?$N$GJs9p$7$^$9!#(B

$B;HMQ$7$F$$$k(Bgcc$B$O(B
gcc version X6_20(Based on 1.40)$B!J#C%^%,G[I[HG!K(B
$B$G!"4D6-JQ?t$K(B
set GCC_OPTION= LFIAMWGTO+
set MARIKO= ABD
$B$,@_Dj$5$l$F$*$j!"(B

gcc -S -O test.c

$B$H$7$F%3%s%Q%$%k$7$?=PNO$G$9!#(B

$BLdBj$N%=!<%9$O#O#h!*#X2+6b=54V#P#R#O!]#6#8#K$K$D$$$F$-$?(BZS_EX$B$N%=!<%9(Bmapping.c$B$+$i$N(B
$BH4?h$G$9!#(B

test.c BEGIN--cut here--cut here---------------------------------------------

double	cx, cy, cz;		/* $BOH$NCf?4(B */
double	fx[4], fy[4], fz[4];	/* $BOH$N;M6y!JCf?4$+$i$NAjBP0LCV!K(B*/
int	ix[4], iy[4];		/* $BI=<(MQ$N:BI8(B */

#define	VZ	512.0		/* $B$3$NCM$,>.$5$$$[$I%Q!<%9$,$-$D$/$+$+$k(B */

void	project()	/* $BF);kEj1F(B */
{
	int	i;
	double	x, y, z;

	for ( i=0; i<4; i++ ) {
		x=cx+fx[i];
		y=cy+fy[i];
		z=cz+fz[i];
		ix[i]=256+(int)((VZ*x/(VZ-z))/1.5);	/* $B%I%C%H=D2#Hf=$@5(B */
		iy[i]=256-(int)(VZ*y/(VZ-z));		/* $B1&<j7O(B-$B:8<j7OJQ49(B */
	}
	return;
}

END----------------------------------------------------------------------

$B$3$N(Btest.c$B$N%3%s%Q%$%k7k2L(Btest.s$B$O0J2<$N$h$&$K$J$j$^$7$?!#%l%8%9%?(Ba5$B$NI>2A$K(B
$B0[>o$,8+$i$l$^$9!#(B

test.s BEGIN--cut here--cut here-------------------------------------------

* NO_APP
peaW	macro	___val
	.dc.w	$4878,___val
	endm
	.text
	.even
	.globl _project
_project:
	link a6,#-16
	movem.l d3/d4/d5/d6/d7/a3/a4/a5,-(sp)
	moveq.l #0,d2
	move.l d2,-4(a6)
	move.l d2,-16(a6)
	moveq.l #0,d7
	lea ___fixdfsi,a5  $B!c$3$3$G(Ba5$B$K$O(Bdouble->int$B7?JQ49%k!<%A%s(B___fixdfsi
			    $B$X$N%"%I%l%9$,F~$k!d(B
?5:
	lea _fx,a0
	move.l _cx,d0
	move.l _cx+4,d1
	lea ___adddf3,a3
	move.l 4(a0,d7.l),-(sp)
	move.l (a0,d7.l),-(sp)
	move.l d1,-(sp)
	move.l d0,-(sp)
	jsr (a3)
	lea 16(sp),sp
	move.l d0,d5
	move.l d1,d6
	lea _fy,a0
	move.l _cy,d0
	move.l _cy+4,d1
	move.l 4(a0,d7.l),-(sp)
	move.l (a0,d7.l),-(sp)
	move.l d1,-(sp)
	move.l d0,-(sp)
	jsr (a3)
	lea 16(sp),sp
	move.l d0,d3
	move.l d1,d4
	lea _fz,a0
	move.l _cz,d0
	move.l _cz+4,d1
	move.l 4(a0,d7.l),-(sp)
	move.l (a0,d7.l),-(sp)
	move.l d1,-(sp)
	move.l d0,-(sp)
	jsr (a3)
	lea 16(sp),sp
	move.l d0,a4
	move.l d1,a5		$B!c2?8N$+$3$3$G(Ba5$B$,GK2u$5$l$F$7$^$&!*!*!*!d(B
	lea ___muldf3,a3
	peaW 0
	move.l #1082130432,-(sp)
	move.l d6,-(sp)
	move.l d5,-(sp)
	jsr (a3)
	lea 16(sp),sp
	move.l d0,-12(a6)
	move.l d1,-8(a6)
	move.l a5,-(sp)
	move.l a4,-(sp)
	peaW 0
	move.l #1082130432,-(sp)
	jsr ___subdf3
	lea 16(sp),sp
	move.l d0,d5
	move.l d1,d6
	lea ___divdf3,a4
	move.l d6,-(sp)
	move.l d5,-(sp)
	move.l -8(a6),-(sp)
	move.l -12(a6),-(sp)
	jsr (a4)
	lea 16(sp),sp
	peaW 0
	move.l #1073217536,-(sp)
	move.l d1,-(sp)
	move.l d0,-(sp)
	jsr (a4)
	lea 16(sp),sp
	move.l d1,-(sp)
	move.l d0,-(sp)
	jsr (a5)	$B!c(Ba5$B$,GK2u$5$l$F$$$k$3$H$r(Bgcc$B$O5$IU$$$F$$$J$$(B
			$B!J(B___fixdfsi$B$N$D$b$j$G$$$k!K!#$3$N8e%"%\!<%H$9$k!#!d(B
	addq.w #8,sp

	$B0J2<N,(B

END----------------------------------------------------------------------

$B$3$N$h$&$K$3$NItJ,$N$_!":GE,2=$r30$7$F%3%s%Q%$%k$7$J$$$H;H$$J*$K$J$j$^$;$s!#(B
$B$3$l$OL@$i$+$K(Bgcc$B$N%P%0$@$H;W$&$N$G$9$,!"$b$&%U%#%C%/%9$5$l$F$$$k$b$N$J$N$G(B
$B$7$g$&$+!)(B

p.s.
>$B$?$7$+@5<0$J%W%m%0%i%`L>$O!V(BSXMovie$B!W$@$C$?$H;W$$$^$9!#(B
>$B;DG0$G$7$?!#(B
$B$X!<!"K\Ev$K<h$j9~$s$@$s$@!&!&!#4hD%$C$F$k$J$"!#(B
$B3'MM!"(Bg2t$B$b$h$m$7$/!*!JB?J,(Bg2t$B$GJQ49$7$F$k$O$:!K(B

p.s.
>$BMhG/$N2F$bA@$C$F$*$j$^$9$N$GM7$S$KMh$F2<$5$$!#(B
>$B$!$c$7$#$H8@$o$l$F$b$?$@$NAp$N:,$N%M%C%H$G$9$+$i!#(B
$B$$$d!"$Z$7$Z$74k2h$O$!$c$7$+$C$?$G$9$h!J>P!K!#(B
$B9T$1$?$i$^$?GA$-$K9T$-$^$9!#(B
-- 
-----------------------------------------------------------------------
  $@6bBtBg3X(J $@9)3XIt(J $@EE5$!&>pJs9)3X2J#4G/(J $@D9Ln8&5f<<(J
$@!!>>B<CN8J(J with X68000ACE-HD XV $@%-%c%j%s%0%O%s%I%k$O0NBg$@(J
--matumura@kitune.ec.t.kanazawa-u.ac.jp--------------------------------