UP
Discriminate Key Type
DISCRIM(0;K==>c;)
returns in c a code depending on the type of key K:
c type of K
1 data key
2 resume key
3 page, segment, node or sense key (memory keys)
4 meter key
5 all others
Fetch keys once produced code 3. It might have to again since
fetch keys with lss>0 may be used as segmode keys.
DISCRIM is mainly for debugging. Normally you will
know what a key is by knowing how you got it.
Programming Note: The ability to discriminate resume keys
is useful to avoid making the alleged key type call on an
resume key!
Design note: This call on DISCRIM was designed to give you
only information that you could have gotten by other means
{albeit destructively and/or statistically}. This statement
is valid at every level of description that excludes the
domain tool and sense keys {and the extended kernel keys}.
{arcane}Design note: Data keys are not synthesizable;
synthetic data keys don't work in segment nodes.
DISCRIM(1;K==>c;)
Returns in c, 0 if K is a read-only page key or a read-only
no-call segment key or a sense key, 1 otherwise. Such keys
are discreet.
DISCRIM(2;K,L==>c;) "Compare keys"
Returns in c, 0 if K and L are the same key, 1 otherwise.
DISCRIM(kt;==>c) returns x'0409' in c.
See (p3,discrim-scr) about
anpother possible DISCRIM function. See (p3,qrn)
for DISCRIM design notes.
Data Key Creator
DATA(CREATE_DATA__6_BYTES,((6,B48));==>c;K) places
DK(B48) in K and 0 in c. If B128 is less than an implementation
defined limit {256**11 here} then
DATA(CREATE_DATA__16_BYTES,((16,B128));==>c;K)
returns 0 in c and DK(B128) in K. If the limit is exceeded
c will be 1 and K will be DK(B128 modulo the limit). DATA(kt;==>c;)
puts X'0309' in c.
The following definitions are in DKCDEFS in both PLIGATES
MACLIB and DOMAIN MACLIB. CREATE_DATA__6_BYTES=0,
CREATE_DATA__16_BYTES=1.
RETURNER
If X is a resume key to a domain which can be jumped
to quickly {its range is mounted} then RETURNER(oc, data
string;K1,K2,K3,X) is equivalent to X(oc, data string;K1,K2,K3).
Otherwise the jump is equivalent to EXTRETURNER(oc, data
string;K1,K2,K3,X). {Today, 4-Oct-82, EXTRETURNER causes
the kernel to crash if X is a resume. If X is not a resume
EXTRETURNER behaves as DK(0).}
LOOSE END how is EXTRETURNER defined? {Calling RETURNER returns
what was passed. RETURNER(kt;==>c;) returns kt in c.}
Programming note: RETURNER can be used to permute or copy
your general key slots or do a backwards MVCL.
{arcane}{ni}Meter Transfer
If M2 is a meter that is inferior to M1 then
METTRAN(0,((8,cpu),(8,ch),(8,core));M1,M2==>c,bs;)
deducts from M2 thru, but not including M1, the three components
cpu, ch and core. If those intermediate meters have limits
smaller than some of these components the smaller amount
is withdrawn. No meter traps are caused. METTRAN(1,...)
is like METTRAN(0,...) except that any exceeded limits do
cause meter traps. METTRAN has application in certain situations
where a meter is passed to another program, but that other
program is running on a remote system.
METTRAN(kt;==>c;) returns X'0809' in c.