The MEMCPY and MEMSET instructions should only examine the low 15 bits of
their length arguments.
+2015-09-29 James Bowman <james.bowman@ftdichip.com>
+
+ * interp.c (step_once): Correct length for MEMSET and MEMCPY
+ instructions.
+
2015-09-29 James Bowman <james.bowman@ftdichip.com>
* interp.c (cpu_mem_write): Do no write PM when locked.
uint32_t src = r_1v;
uint32_t dst = cpu->state.regs[r_d];
uint32_t i;
- for (i = 0; i < rimmv; i++)
+ for (i = 0; i < (rimmv & 0x7fff); i++)
PUT_BYTE (dst + i, GET_BYTE (src + i));
}
break;
/* memset instruction. */
uint32_t dst = cpu->state.regs[r_d];
uint32_t i;
- for (i = 0; i < rimmv; i++)
+ for (i = 0; i < (rimmv & 0x7fff); i++)
PUT_BYTE (dst + i, r_1v);
}
break;