1*b65ab6e5Sbostic /*-
2*b65ab6e5Sbostic * Copyright (c) 1986 The Regents of the University of California.
3*b65ab6e5Sbostic * All rights reserved.
4*b65ab6e5Sbostic *
5*b65ab6e5Sbostic * This code is derived from software contributed to Berkeley by
6*b65ab6e5Sbostic * Computer Consoles Inc.
7*b65ab6e5Sbostic *
8*b65ab6e5Sbostic * %sccs.include.redist.c%
9*b65ab6e5Sbostic *
10*b65ab6e5Sbostic * @(#)Aaobleq.c 7.1 (Berkeley) 12/06/90
11*b65ab6e5Sbostic */
121edaaf10Ssam
13f5878f6dSbostic #include "align.h"
aobleq(infop)141edaaf10Ssam aobleq(infop) process_info *infop;
151edaaf10Ssam /*
161edaaf10Ssam /* Add one, branch if less or equal.
171edaaf10Ssam /* Can't use real HW opcodes since we don't want to branch here.
181edaaf10Ssam /*
191edaaf10Ssam /*******************************************/
201edaaf10Ssam {
211edaaf10Ssam register long limit, index, new_address, complement;
221edaaf10Ssam
231edaaf10Ssam limit = operand(infop,0)->data;
241edaaf10Ssam index = operand(infop,1)->data;
251edaaf10Ssam complement = limit + ~index;
261edaaf10Ssam if ( complement < 0){ carry_0; negative_1;} else{negative_0; carry_1;}
271edaaf10Ssam if ( complement == 0) zero_1; else zero_0;
281edaaf10Ssam overflow_0;
291edaaf10Ssam write_back (infop, index+1, operand(infop,1));
301edaaf10Ssam new_address = operand(infop,2)->address;
311edaaf10Ssam if (!negative || zero) pc = new_address;
321edaaf10Ssam }
33