diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index b6b6a4c90..f8275e9a8 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -353,8 +353,7 @@ thread bit vector. This instruction adds, subtracts, or multiplies an immediate value to the addressed index register. The index register holds numeric values, -so the is a number. The value selects the index register, -and may be 0, 1, 2 or 3. +so the is a number. The value selects the index register. * %jmp diff --git a/vvp/vthread.cc b/vvp/vthread.cc index d8bde41d0..5915a71bf 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1840,19 +1840,19 @@ bool of_INV(vthread_t thr, vvp_code_t cp) bool of_IX_ADD(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int += cp->number; + thr->words[cp->bit_idx[0]].w_int += cp->number; return true; } bool of_IX_SUB(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int -= cp->number; + thr->words[cp->bit_idx[0]].w_int -= cp->number; return true; } bool of_IX_MUL(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int *= cp->number; + thr->words[cp->bit_idx[0]].w_int *= cp->number; return true; }