From beb759b7e65ef60199da1c9d2634b8a82830ee0d Mon Sep 17 00:00:00 2001 From: julianb0 Date: Fri, 7 Jun 2019 23:25:47 +0200 Subject: [PATCH] vm --- vm/pc/decd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vm/pc/decd.c b/vm/pc/decd.c index 8b74a2e..fc19ce4 100644 --- a/vm/pc/decd.c +++ b/vm/pc/decd.c @@ -17,7 +17,7 @@ static void check_param_type(ctx_t *ctx, uint prm, uchar fmt) else if (prm == P_IMM) ok = (fmt == A_IMM64); - else /* if (prm == P_MEM */ + else /* if (prm == P_MEM) */ ok = ACC_FMT_IS_MEM(fmt); if (!ok) @@ -34,7 +34,8 @@ void decode(ctx_t *ctx) acc_t p1 = { 0 }; acc_t p2 = { 0 }; - bool rep = 0, cond = 0; + bool rep = 0 + uint cond = 0; bool lock, nomore; ushort w1, w2; @@ -75,7 +76,7 @@ void decode(ctx_t *ctx) w2 = ctx->get(ctx); // REP and COND - rep = w2 & PREF_REP; + rep = !!(w2 & PREF_REP); cond = (w2 & BITS_COND) >> COND_SHIFT; // F1 and F2 @@ -372,10 +373,10 @@ do_rep: { if (p1->type == A_REG) R(p1->reg) = ret; - + else if (p1->type == A_IMM64) - _except(ctx, E_ACC, "Trying to output on an IMM64"); - + _except(ctx, E_ACC, "Trying to output to an IMM64"); + else { assert(ACC_IS_MEM(p1));