MOVI: SP and RP banned

This commit is contained in:
Giulio De Pasquale 2017-07-08 22:57:56 +02:00
parent b130322de5
commit 3b01c3a71c

View File

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