xref: /titanic_41/usr/src/cmd/eqn/move.c (revision 779fc935796a940997d18b31d64a9fec9c6b40f6)
1*779fc935Sceastha /*
2*779fc935Sceastha  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3*779fc935Sceastha  * Use is subject to license terms.
4*779fc935Sceastha  */
5*779fc935Sceastha 
67c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
77c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
117c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
127c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate 
15*779fc935Sceastha #pragma ident	"%Z%%M%	%I%	%E% SMI"
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate #include "e.h"
187c478bd9Sstevel@tonic-gate #include "e.def"
197c478bd9Sstevel@tonic-gate 
20*779fc935Sceastha void
move(int dir,int amt,int p)21*779fc935Sceastha move(int dir, int amt, int p)
22*779fc935Sceastha {
237c478bd9Sstevel@tonic-gate 	int a;
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate 	yyval = p;
267c478bd9Sstevel@tonic-gate #ifndef NEQN
277c478bd9Sstevel@tonic-gate 	a = VERT(EM(amt/100.0, EFFPS(ps)));
28*779fc935Sceastha #else	/* NEQN */
297c478bd9Sstevel@tonic-gate 	a = VERT((amt+49)/50);	/* nearest number of half-lines */
30*779fc935Sceastha #endif	/* NEQN */
317c478bd9Sstevel@tonic-gate 	printf(".ds %d ", yyval);
327c478bd9Sstevel@tonic-gate 	if (dir == FWD || dir == BACK)	/* fwd, back */
337c478bd9Sstevel@tonic-gate 		printf("\\h'%s%du'\\*(%d\n", (dir == BACK) ? "-" : "", a, p);
347c478bd9Sstevel@tonic-gate 	else if (dir == UP)
357c478bd9Sstevel@tonic-gate 		printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
367c478bd9Sstevel@tonic-gate 	else if (dir == DOWN)
377c478bd9Sstevel@tonic-gate 		printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
38*779fc935Sceastha 	if (dbg)
39*779fc935Sceastha 		printf(".\tmove %d dir %d amt %d; h=%d b=%d\n",
407c478bd9Sstevel@tonic-gate 		    p, dir, a, eht[yyval], ebase[yyval]);
417c478bd9Sstevel@tonic-gate }
42