Currently, branch instructions have to do something like this in their eval() function:
ProgramCounter.setValue(ProgramCounter.getValue() + offset);
archsim will still increment the value of the program counter, even if the user sets it. We should allow an "options" object as the second argument to setValue:
ProgramCounter.setValue(ProgramCounter.getValue() + offset, {
increment: true
});
This gives user finer controls over their architecture, and means no nasty hacks to adjust for the mandatory increment.
Currently, branch instructions have to do something like this in their
eval()function:archsim will still increment the value of the program counter, even if the user sets it. We should allow an "options" object as the second argument to
setValue:This gives user finer controls over their architecture, and means no nasty hacks to adjust for the mandatory increment.