fixed bug in translation of BR instruction
authorceriel <none@none>
Mon, 15 Jan 1990 11:44:43 +0000 (11:44 +0000)
committerceriel <none@none>
Mon, 15 Jan 1990 11:44:43 +0000 (11:44 +0000)
mach/vax4/as/mach5.c

index bc19130..42e3f4b 100644 (file)
@@ -213,7 +213,7 @@ branch(opc, exp)
                exp.val -= DOTGAIN;
        }
        if (pass >= PASS_2 &&
-           ((exp.typ & ~S_DOT) != DOTTYP || ! fitw(exp.val))) {
+           ((exp.typ & ~S_DOT) != DOTTYP || ! fitw(exp.val-1))) {
                serror("label too far");
        }
        if (small(fitb(exp.val) && ((exp.typ & ~S_DOT) == DOTTYP), 1)) {
@@ -222,7 +222,7 @@ branch(opc, exp)
        }
        else {
                emit1(opc|0x20);
-               emit2((int) exp.val);
+               emit2((int) (exp.val - 1));
        }
 }