xref: /original-bsd/sys/tahoe/align/align.c (revision 506c9b6a)
1 /*-
2  * Copyright (c) 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Computer Consoles Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)align.c	7.1 (Berkeley) 12/06/90
11  */
12 
13 #include	"align.h"
14 
15 /*
16  * Part of the parameter list is set up by locore.s.
17  * First 2 dummy variables MUST BE the first local
18  * variables; leaving place for registers 0 and 1
19  * which are not preserved by the current C compiler.
20  * Then, the array of structures and the last_operand
21  * HAVE to be in the given order, to correspond to the
22  * description of process_info in 'alignment.h'.
23  */
24 alignment()
25 {
26 	long	space_4_Register_1;	/* register 1 */
27 	long	space_4_Register_0;	/* register 0 */
28 	struct	oprnd	space_4_decoded[4];
29 	long	space_4_opcode;
30 	long	space_4_last_operand;	/* Last operand # processed */
31 	long	space_4_saved_pc;
32 	long	space_4_saved_sp;
33 
34 	register process_info *infop;
35 
36 	infop = (process_info *)&space_4_saved_sp;
37 	saved_pc = pc;
38 	saved_sp = sp;	     			/* For possible exceptions */
39 
40 	last_operand = -1;   /* To get the operand routine going correctly */
41 
42 	opCODE = 0xff & *(char *)pc;
43 	pc++;
44 	(*Table[opCODE].routine) (infop);	/* Call relevant handler */
45 	/*
46 	 * NOTE: nothing should follow, except the return.
47 	 * The register variables cannot be trusted anymore,
48 	 * if an exception is signalled.  See 'exception.c'
49 	 * to understand why.
50 	 */
51 }
52