diff --git a/src/emucore/CortexM0.cxx b/src/emucore/CortexM0.cxx index eeb6953cf..961ec562a 100644 --- a/src/emucore/CortexM0.cxx +++ b/src/emucore/CortexM0.cxx @@ -999,6 +999,9 @@ CortexM0::err_t CortexM0::execute(uInt16 inst, uInt8 op) rc = ra + rb; if(rd == 15) { + if ((rc & 1) == 0) + return errIntrinsic(ERR_INVALID_OPERATING_MODE, read_register(15) - 4); + rc &= ~1; //write_register may f this as well rc += 2; //The program counter is special }