diff --git a/vm/vm.cpp b/vm/vm.cpp index e035e7b..0e487e5 100644 --- a/vm/vm.cpp +++ b/vm/vm.cpp @@ -142,8 +142,8 @@ bool VM::execMOVI(void) { dst = as.code[regs[IP] + 1]; imm = *((uint16_t *)&as.code[regs[IP] + 2]); DBG_INFO(("MOVI %s, 0x%x\n", getRegName(dst), imm)); - if (dst == IP) { - DBG_ERROR(("Can't MOVI to IP!\n")); + if (dst == IP || dst == SP || dst == RP) { + DBG_ERROR(("MOVI: Invalid register!\n")); return false; } regs[dst] = imm;