xref: /csrg-svn/sys/tahoe/align/Awrite_quad.c (revision 29643)
1*29643Ssam /*	Awrite_quad.c	1.1	86/07/20	*/
2*29643Ssam 
3*29643Ssam #include	"../tahoealign/align.h"
4*29643Ssam 
5*29643Ssam write_quadword (infop, qword, where)
6*29643Ssam process_info	*infop;
7*29643Ssam quadword 	qword;
8*29643Ssam struct oprnd 	*where;
9*29643Ssam /*
10*29643Ssam /*	Put the quadword at the given address in memory.
11*29643Ssam /*
12*29643Ssam /*
13*29643Ssam /**************************************************/
14*29643Ssam {
15*29643Ssam 	if (! (where->mode & W)) exception(infop, ILL_ADDRMOD);
16*29643Ssam 	switch (where->mode & ADDFIELD)	/* Mask out R/W bits */
17*29643Ssam 	{
18*29643Ssam 	case Add:
19*29643Ssam 		put_longword (infop, qword.high, where->address);
20*29643Ssam 		where->address += 4;
21*29643Ssam 		put_longword (infop, qword.low, where->address);
22*29643Ssam 		break;
23*29643Ssam 	case Dir:
24*29643Ssam 		if ( where->reg_number >= SPOINTER || (where->reg_number & 1) == 1 )
25*29643Ssam 			exception (infop, ILL_OPRND);
26*29643Ssam 		Replace (infop, where->reg_number, qword.high);
27*29643Ssam 		Replace (infop, where->reg_number+1, qword.low);
28*29643Ssam 		break;
29*29643Ssam 	case SPmode:
30*29643Ssam 		exception(infop, ILL_ADDRMOD);
31*29643Ssam 		break;
32*29643Ssam 	default:
33*29643Ssam 		printf("Unknown destination in write_quad (alignment code)\n");
34*29643Ssam 	};
35*29643Ssam }
36