1 #define RCSID5 "$Id: mach5.c,v 1.8 1994/06/24 13:11:25 ceriel Exp $"
4 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * See the copyright notice in the ACK home directory, in the file "Copyright".
12 if (mode == 067 || mode == 077) {
13 exp_1.val = adjust(exp_1);
17 RELOMOVE(relonami, rel_1);
18 if (rflag != 0 && PASS_RELO)
19 newrelo(exp_1.typ, RELO2|relpc);
29 if (mode == 067 || mode == 077) {
31 exp_2.val = adjust(exp_2);
34 RELOMOVE(relonami, rel_2);
35 if (rflag != 0 && PASS_RELO)
36 newrelo(exp_2.typ, RELO2|relpc);
43 branch(opc,exp) expr_t exp; {
47 eval = adjust(exp) >> 1;
49 if ((exp.typ & ~S_DOT) != DOTTYP && pass >= PASS_2) sm = 0;
50 if (!sm && pass >= PASS_2) {
51 serror("label too far");
53 emit2(opc | lowb(eval));
56 ejump(opc, exp) expr_t exp; {
61 eval = adjust(exp) >> 1;
63 if ((exp.typ & ~S_DOT) != DOTTYP) {
66 gain = (opc == OPBRA ? 2 : 4);
68 emit2( opc | lowb(eval));
73 emit2((opc^0400) | 02);
85 sob(reg, exp) expr_t exp; {
86 if ((exp.typ & ~S_DOT) != DOTTYP) {
87 serror("error in sob-label");
89 exp.val = ( - adjust(exp) ) >> 1;
91 emit2( OPSOB | (reg << 6) | exp.val);
101 val = adjust(exp_1) >> 1;
102 if ( fitb(val) && (exp_1.typ & ~S_DOT) == DOTTYP) {
106 emit2(OPBRA | lowb(val));
116 valu_t adjust(exp) expr_t exp; {
119 val = exp.val - DOTVAL - 2;
121 if (pass == PASS_2 && val > 0) val -= DOTGAIN;