Fix bug with imm16 processing
This commit is contained in:
@@ -83,7 +83,8 @@ Instruction decodeInstruction(Memory* m, uint32_t* pc) {
|
||||
case OP_IMM16: { // the immediate 16 takes up the space where the next instruction would be
|
||||
(*pc) += sizeof(SerializedInst);
|
||||
|
||||
uint16_t nextDataOver = m->data[*pc];
|
||||
uint16_t nextDataOver;
|
||||
memcpy(&nextDataOver, &m->data[*pc], sizeof(uint16_t));
|
||||
outputInst.immediate = nextDataOver;
|
||||
outputInst.hasImm16 = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user