Self-modified code execution timing
Mark Swann
Posts: 124
If, due to pipelining issues beyond our control,·it is true that·we must insert at least·one·NOP, or perhaps something more meaningful, before an instruction that has been modified with MOVS,·MOVD or MOVI, then is the same true of a CALL or JMPRET if the first instruction in the subroutine is a return (i.e. RET)? (Please don't ask why I would do something so silly.)
Thanks
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The more I know, the more I know I don't know.· Is this what they call Wisdom?
There might be people designing their program top-down according to some "stepwise refinement philosophy", first writing stubs with nothing but a RET in it....
"CALL is a really a subset of the JMPRET instruction; in fact, it is the same opcode as JMPRET but
with the i-field set (since CALL uses an immediate value only) and the d-field set to the address
of a label named Address_ret.
The return address is written to the Address_ret register unless the NR effect is specified."
page 361
However as dest-address and new-instruction-address are available inside the processor at the right time, so - both being equal - it could postpone instruction fetch for 4 further cycles as it does in case of a conditional non-jump...
-Phil
Pipelines are great, except when they break. I'm sure you can ask a few native Alaskans about that.