xref: /original-bsd/sys/tahoe/align/Acasel.c (revision b30b9691)
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  *	@(#)Acasel.c	7.1 (Berkeley) 12/06/90
11  */
12 
13 #include "align.h"
14 casel(infop)	process_info *infop;
15 /*
16 /*	Case (longword).
17 /*	Can't use real HW opcode, don't want to branch out !
18 /*
19 /***********************************/
20 {
21 	register long selector, base;
22 	register unsigned temporary, limit;
23 
24 	selector = operand(infop,0)->data;
25 	base = operand(infop,1)->data;
26 	limit = operand(infop,2)->data;
27 	if (pc & 1) pc += 1;	/* Displacements are aligned ! */
28 	temporary = selector - base;
29 	if (temporary <= limit)
30 		pc = pc + get_word (infop, (char *)(pc + 2*temporary) );
31 	else pc = pc + limit*2 + 2;
32 }
33