There are no other files named sail.jsys in the archive.
Calling JSYSes In SAIL
May 22, 1975
The most common way that JSYSes are called in TENEX SAIL
is by using the runtime routines. Most of the system
calls that users have wanted to make in the past two years
at IMSSS have been added as runtime routines. However, the
need still exists to call other JSYSes, and new ones may be
added in the future by BBN and individual sites.
The SAIL START!CODE facility is the most used way
of calling JSYSes, particularly for those familiar with
machine language. The START!CODE assembler is evoked
inline by the SAIL statement:
machine instructions ending with semicolons
which itself is a block or compound statement in the
language (i.e., declarations can occur after the word
START!CODE in the way that declarations can occur after
BEGIN. Note that labels inside the block must be declared.)
In the START!CODE assembler (which is more fully
described in the Van Lehn SAIL manual) valid PDP10 instructions
are accepted in the form
OPCODE AC, location ;
where OPCODE is a PDP10 opcode, AC an AC number, and LOCATION
is a label or a literal. LOCATION may contain the indirect
(@) sign, and may be indexed. Literals are one location only
and contain SAIL arithmetic expressions.
For example, the following does a HALTF
and the following would do the NOUT jsys to the terminal,
printing out the number 15 in decimal notation. Note that
numbers inside START!CODE are decimal.
MOVEI 1,'101; COMMENT primary output;
MOVEI 2,15; COMMENT number 15 to print;
MOVEI 3,10; COMMENT radix to print it in;
NOUT; COMMENT print it;
JFCL; COMMENT error return;
If the number that one wanted to print were in INTEGER I, the
following would be correct:
MOVE 3,I; COMMENT assembler uses
address of I here;
(Note: this is not how one would print out a number in SAIL,
generally one would OUTSTR(CVS(I)) for example. It is more
efficient since it does not evoke the monitor NOUT code.)
As mentioned, many SAIL users have used START!CODE
for these purposes. There is also a function JSYS that
is available on-line at IMSSS and SUMEX by inserting
REQUIRE "<SAIL>JSYS" SOURCE!FILE;
at declaration level. This includes a routine JSYS that does
(1) JSYS accepts two arguments. The first argument
is a string naming a JSYS. The second is a five-element
array. The elements of the array are for the accumulators
into and out of the JSYS call. Thus, one puts arguments
for the accumulators into the array, and values returned
by the JSYS will be returned in the array.
(2) JSYS returns, as the value of the call,
where the return from the JSYS was. If the JSYS function returns 1,
then the return from the JSYS itself was +1, etc.
(3) JSYS is quite inefficient compared to START!CODE.
However, it may be implemented as a part of the compiler in which
case it would be quite efficient.
For example, the following scenarios correspond to the
INTEGER ARRAY ACS[1:5];
JSYS("HALTF",ACS); COMMENT DO A HALTF;
ACS_'101; ACS_15; ACS_10;
ACS_'101; ACS_I; COMMENT I declared integer; ACS_10;
If we wanted to check that the NOUT jsys executed
without error, the last line could be replaced by the following:
IF JSYS("NOUT",ACS) NEQ 2 THEN ...error code...;
i.e., we would check that the return was "+2" in the sense of
the JSYS manual.