xref: /original-bsd/sys/tahoe/align/Awrite_quad.c (revision b65ab6e5)
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  *	@(#)Awrite_quad.c	7.1 (Berkeley) 12/06/90
11  */
12 
13 #include	"align.h"
14 
write_quadword(infop,qword,where)15 write_quadword (infop, qword, where)
16 process_info	*infop;
17 quadword 	qword;
18 struct oprnd 	*where;
19 /*
20 /*	Put the quadword at the given address in memory.
21 /*
22 /*
23 /**************************************************/
24 {
25 	if (! (where->mode & W)) exception(infop, ILL_ADDRMOD);
26 	switch (where->mode & ADDFIELD)	/* Mask out R/W bits */
27 	{
28 	case Add:
29 		put_longword (infop, qword.high, where->address);
30 		where->address += 4;
31 		put_longword (infop, qword.low, where->address);
32 		break;
33 	case Dir:
34 		if ( where->reg_number >= SPOINTER || (where->reg_number & 1) == 1 )
35 			exception (infop, ILL_OPRND);
36 		Replace (infop, where->reg_number, qword.high);
37 		Replace (infop, where->reg_number+1, qword.low);
38 		break;
39 	case SPmode:
40 		exception(infop, ILL_ADDRMOD);
41 		break;
42 	default:
43 		printf("Unknown destination in write_quad (alignment code)\n");
44 	};
45 }
46