Fix emulate so not increment PC if branch inst, w/ T
This commit is contained in:
parent
851a54a51e
commit
20557a14eb
@ -1,5 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "a64instruction.h"
|
||||
#include "emulator.h"
|
||||
#include "fileio.h"
|
||||
#include "global.h"
|
||||
@ -47,7 +48,8 @@ int main(int argc, char **argv) {
|
||||
// Step 3: Update processor state to reflect executing the instruction, and increment PC
|
||||
execute(&state, inst);
|
||||
|
||||
state.pc += sizeof(word);
|
||||
if (inst->type != a64inst_BRANCH)
|
||||
state.pc += sizeof(word);
|
||||
} while (inst->type != a64inst_HALT);
|
||||
|
||||
state.pc -= sizeof(word);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user