xref: /csrg-svn/sys/tahoe/align/Aaoblss.c (revision 45760)
1*45760Sbostic /*-
2*45760Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*45760Sbostic  * All rights reserved.
4*45760Sbostic  *
5*45760Sbostic  * This code is derived from software contributed to Berkeley by
6*45760Sbostic  * Computer Consoles Inc.
7*45760Sbostic  *
8*45760Sbostic  * %sccs.include.redist.c%
9*45760Sbostic  *
10*45760Sbostic  *	@(#)Aaoblss.c	7.1 (Berkeley) 12/06/90
11*45760Sbostic  */
1229589Ssam 
1345699Sbostic #include "align.h"
aoblss(infop)1429589Ssam aoblss(infop)	process_info *infop;
1529589Ssam /*
1629589Ssam /*	Add one, branch if less than.
1729589Ssam /*	Can't use real HW opcode, don't want to branch out of here !
1829589Ssam /*
1929589Ssam /*******************************************/
2029589Ssam {
2129589Ssam 	register long limit, index, new_address, complement;
2229589Ssam 
2329589Ssam 	limit = operand(infop,0)->data;
2429589Ssam 	index = operand(infop,1)->data;
2529589Ssam 	complement =  limit + ~index;
2629589Ssam 	if ( complement < 0){ carry_0; negative_1;}else{carry_1; negative_0;}
2729589Ssam 	if ( complement == 0) zero_1; else zero_0;
2829589Ssam 	overflow_0;
2929589Ssam 	write_back (infop,index+1, operand(infop,1));
3029589Ssam 	new_address = operand(infop,2)->address;
3129589Ssam 	if (!negative && !zero) pc = new_address;
3229589Ssam }
33