4 ms·
Most of these implementations change the stack pointer as a side effect of decoding a skipped instruction: IFN a, a Set Push, 1 Is this the intended behavior?
by MarkSweep 15y ago
Most of these implementations change the stack pointer as a side effect of decoding a skipped instruction:
IFN a, a
Set Push, 1
Is this the intended behavior?
- dkersten 15y agoYes, I think so because branches skip full instructions and instructions may be between 1 and 3 bytes but exactly how many is unknown until the skipped instruction is decoded.
- MarkSweep 15y agoThe PC needs to be incremented past the "next words". But it seems odd that a un-executed push instruction would still modify SP.
- ashleyf 15y agoI believe you're right @MarkSweep. Thanks much for pointing that out! Fixed.
- dkersten 15y agoThis is true - I actually miss-read your comment and thought you said instruction pointer instead of stack pointer... It seems to be a bug in the implementation (from my reading of the spec, this should not happen).