DRL.DRL - execute a given TSS derail (system call).

Alternate Entry Name: DRL_DRL

Usage:

B:
   extrn drl.a, drl.q;
   ...
   drl.drl( number [,arg1, arg2, ...] );
C:
   extern drl_a, drl_q;
   ...
   void drl_drl(int number, ...);

Where:

number
is the number of the Derail to be executed.
arg1, arg2, ...
is a list of words to follow the DRL machine instruction.

Description:

DRL.DRL allows direct access to the TSS Derail calls. The A and Q registers are loaded from the externals "drl.a" and "drl.q" respectively, just before the derail is executed. After the derail returns, the eight word external "sy.reg" is set to the contents of the registers. "drl.a" and "drl.q" are part of "sy.reg" and will contain the contents of the A and Q registers. Note that "sy.reg" is an eight word external, not a B vector.

It is possible to use Derails which require an error exit or a place to go to, since the Derail is executed in the stack using the stack pointer of the caller. This is handy if you are trying to execute a Derail that needs a separate denial return or the address of the place to return to. For example,

%b/manif/drls
    opts[2] = opts[3] = 1;
    acc.fil( "gcos3/gcos-hi-3ic", opts, ret );
    buf = getvec(600);
    ret[2] = `.mbrt3`;
    drl.drl(RESTOR_, ret<<18 | 1, buf<<18 | 1,
            (tra&0777777000000)|(buf+512));
tra:
    printf( "%24b*n", buf+4+status*4 );
    rlsevec(buf,600);

This code sequence, which obtains a batch error message by locating it in the batch error message module, uses the value of a label to supply a return address to DRL RESTOR.

The above should only be considered an example of DRL.DRL since DRL RESTOR can called far more easily using the B library routine .RESTR.

Notes:

The Derail number is an 18 bit quantity. If you wish to execute a negative Derail make sure the upper 18 bits of "number" are zero (e.g. (-2) & 0777777). The upper 18 bits are added to the DRL opcode, and may be used to specify an address tag like that used by DRL SETSWH.

See Also:

expl b lib .restr

expl b lib external sy.reg

Copyright © 1996, Thinkage Ltd.