(GCOS-8 only)
result = _exec(aq, inst1, inst2, ...);
struct { int a, q; } aq;
"_exec" loads the A and Q registers with specified values, then executes a specified set of machine instructions.
Loosely speaking, the result of "_exec" is the value of the A and Q registers after the instructions have been executed. However, the actual result depends on the way you declare "_exec".
double dval; double _exec(struct aq, ...); dval = _exec( /* args */ );
assigns the value of the EAQ register to "dval".
typedef struct { int a, q; } AQ; AQ result_aq, _exec(AQ, ...); result_aq = _exec( /* args */ );
captures the value of the A and Q registers.
int q, _exec(struct aq, ...); q = _exec( /* args * / );
to obtain just the value in the Q register.
In other words, the way you declare "_exec" determines where the compiler looks for the result. Naturally, the specified machine instructions must ensure that the result is left where the compiler expects to find it.
You can also vary the way that argument values are passed to "_exec". The first machine word of the argument values is always passed in the A register and the second machine word is always passed in the Q register. Therefore, if you call the function with
_exec(aq, inst1, ...);
the first two words of the "aq" structure are passed in the A and Q registers. However, you could also use constructs like
double dval; _exec(dval, inst1, ...);
where the "double" value is passed in the AQ register, or
int a, q; _exec(a, q, inst1, ...);
where you pass two integers, one for the A register and one for the Q.
If you call the "_exec" function with different calling sequences within the same compilation unit, give each calling sequence a different name and use the #equate directive to associate the different names with "_exec", as in
#equate d_exec _exec typedef struct { int a, q; } AQ; double d_exec(AQ aq, ...); AQ _exec(int a, int q, ...);
By using different names, you can avoid diagnostic messages
about conflicts between calling sequences.
Copyright © 1996, Thinkage Ltd.