diff --git a/src/emulate.c b/src/emulate.c index df2f471..82245e9 100755 --- a/src/emulate.c +++ b/src/emulate.c @@ -1,5 +1,6 @@ #include #include +#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);