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 * @(#)Aaobleq.c 7.1 (Berkeley) 12/06/90
11*45760Sbostic */
1229588Ssam
1345699Sbostic #include "align.h"
aobleq(infop)1429588Ssam aobleq(infop) process_info *infop;
1529588Ssam /*
1629588Ssam /* Add one, branch if less or equal.
1729588Ssam /* Can't use real HW opcodes since we don't want to branch here.
1829588Ssam /*
1929588Ssam /*******************************************/
2029588Ssam {
2129588Ssam register long limit, index, new_address, complement;
2229588Ssam
2329588Ssam limit = operand(infop,0)->data;
2429588Ssam index = operand(infop,1)->data;
2529588Ssam complement = limit + ~index;
2629588Ssam if ( complement < 0){ carry_0; negative_1;} else{negative_0; carry_1;}
2729588Ssam if ( complement == 0) zero_1; else zero_0;
2829588Ssam overflow_0;
2929588Ssam write_back (infop, index+1, operand(infop,1));
3029588Ssam new_address = operand(infop,2)->address;
3129588Ssam if (!negative || zero) pc = new_address;
3229588Ssam }
33