On Tue, Sep 2, 2014 at 4:05 PM, Kevin Keith <krfkeith at gmail.com> wrote:
As I understand it, what these instructions do is
basically jump to a
word in memory, execute that word as an instruction, and them jump
right back. What were the usages of these in standard code? What was
the rationale behind them?
I am working with entirely different hardware and software, but I have
encountered functionally equivalent execute instructions used to adapt the
code to hardware variations; e.g. different models of the I/O controller
had different ways of getting the value of a status register. There is
some initialization code like:
int get_status_instruction;
initialize ()
{
...
if (dev_type == model_a)
get_status_instruction = 0040355000; // instruction to read
status from model A
else
get_status_instruction = 004488730; // instruction to read
status from model B
...
}
#define get_status xeq(get_status_instruction)
code...
status = get_status;
So, the idea is that the overhead of the execute instruction is less then
the over head of checking the dev_type every time you need the status, and
is easily changed to handle additional variations since only the initialize
routine needs to be modified.
-- Charles