2 * Sources of the "BRANCH" group instructions
5 /* $Id: do_branch.c,v 2.3 1994/06/24 10:46:07 ceriel Exp $ */
16 /* Note that in the EM assembly language brach instructions have
17 lables as their arguments, where in the EM machine language they
18 have (relative) offsets as parameters. This is not described in the
19 EM manual but follows from the Pascal interpreter.
22 #define do_jump(j) { newPC(PC + (j)); }
27 /* BRA b: Branch unconditionally to label b */
29 LOG(("@B6 DoBRA(%ld)", jump));
36 /* BLT b: Branch less (pop 2 words, branch if top > second) */
37 register long t = wpop();
39 LOG(("@B6 DoBLT(%ld)", jump));
48 /* BLE b: Branch less or equal */
49 register long t = wpop();
51 LOG(("@B6 DoBLE(%ld)", jump));
60 /* BEQ b: Branch equal */
61 register long t = wpop();
63 LOG(("@B6 DoBEQ(%ld)", jump));
72 /* BNE b: Branch not equal */
73 register long t = wpop();
75 LOG(("@B6 DoBNE(%ld)", jump));
84 /* BGE b: Branch greater or equal */
85 register long t = wpop();
87 LOG(("@B6 DoBGE(%ld)", jump));
96 /* BGT b: Branch greater */
97 register long t = wpop();
99 LOG(("@B6 DoBGT(%ld)", jump));
102 do_jump(arg_c(jump));
108 /* ZLT b: Branch less than zero (pop 1 word, branch negative) */
110 LOG(("@B6 DoZLT(%ld)", jump));
113 do_jump(arg_c(jump));
119 /* ZLE b: Branch less or equal to zero */
121 LOG(("@B6 DoZLE(%ld)", jump));
124 do_jump(arg_c(jump));
130 /* ZEQ b: Branch equal zero */
132 LOG(("@B6 DoZEQ(%ld)", jump));
135 do_jump(arg_c(jump));
141 /* ZNE b: Branch not zero */
143 LOG(("@B6 DoZNE(%ld)", jump));
146 do_jump(arg_c(jump));
152 /* ZGE b: Branch greater or equal zero */
154 LOG(("@B6 DoZGE(%ld)", jump));
157 do_jump(arg_c(jump));
163 /* ZGT b: Branch greater than zero */
165 LOG(("@B6 DoZGT(%ld)", jump));
168 do_jump(arg_c(jump));