1df7ead354ddfe3695258b1e86d45b9136bd7f25
[its.git] / sysdoc / _calls.124
1 Copyright (c) 1999 Massachusetts Institute of Technology
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or (at
6 your option) any later version.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 ------------------------------
17
18 ITS CALLS:
19
20 This file attempts to maintain up-to-date documentation on all
21 symbolic ("new") system calls.  Those wonderful souls who update the
22 information in any way (additions, deletions, corrections) should
23 describe their modifications in a brief note to INFO-ITS@AI so that
24 interested parties can correct their copies or conceptions without
25 needing to print or read the entire file again.  For example:
26
27         :MAIL INFO-ITS@AI I added more details to the "FOO" call ^C
28
29 If you want to be put on the INFO-ITS mailing list,
30 just say so in a message to it.
31 -------------------------------------------------
32
33 The format for executing a new system call is:
34
35 CALL:   .CALL CALBLK            ;the call itself
36         ;error return is to CALL+1
37         ;successful return is to CALL+2
38
39
40         ...
41
42 CALBLK: SETZ            ;always
43         SIXBIT /NAME/   ;where "NAME" is any implemented call
44         parm1           ;parameters start here
45         parm2
46
47         ...
48
49         SETZ parmn      ;bit 4.9 (SETZ) => last argument
50
51 A list of all implemented system calls may be seen in
52 AI:SYSTEM;ITS > starting at SYSCTB:.  The actual addresses
53 within ITS where each call is executed may be found from the
54 table starting at SYSCTD:.
55
56 There are four types of parameters:
57         (input)         argument
58         (output)        value
59         (error)         error return code
60         (input)         control
61
62 Bits 4.1-4.3 of the parameter word form an "op code"
63 for that parameter:
64
65     Op Code     Meaning                 Symbol   Value
66
67         0       argument                %CLIN    0000
68         1       immediate argument      %CLIMM   1000
69         2       value                   %CLOUT   2000
70         3       error return code       %CLERR   3000
71         4       control                 %CLBTW   4000
72         5       immediate control       %CLBIT   5000
73
74
75 The indirect, index, and address fields are used to calculate
76 an effective address, PDP-10 style. These point to the location
77 where the argument is or the output is to be placed. For
78 immediate parameters the address itself is the argument or
79 control bits. (Some calls update their input arguments. Such
80 arguments may not be immediate.)
81
82 The order of the input arguments matters; so does the order of
83 the output values. Other than that, the order is irrelevant.
84 (As a matter of style, one normally writes them in the order
85 "control, arguments, values, errors" for clarity.  In the descriptions
86 given here the parameters will always be described in that order.)
87
88 If too many input arguments are present, the excess are ignored,
89 except that more than 9 arguments will cause error 15. If too
90 few arguments are present, error 30 occurs. If too many output
91 values are specified, the extra values will be garbage. If too
92 few output values are specified, only those specified will
93 receive information, and any extra output is thrown away.
94 Specifying more than one error return parameter causes error 15.
95 Specifying an illegal sixbit name for the call causes error 43.
96
97 If an error return parameter is specified, then if the call
98 takes the non-skip return an error code will (probably) have
99 been stored into the error return parameter.  It is also
100 stored into the I/O Status Word of some channel, as before.
101 If the call fails but no error code is returned, the error
102 return parameter is zeroed.  Note that the error return parameter
103 is also zeroed if the call succeeds.  Also, since this zeroing
104 takes place when the arguments are first processed, the error
105 return parameter should not be located on top of any input
106 arguments.  Only one error return parameter is permitted.
107
108 The values of all control bit parameters given are XOR'ed 
109 together, and the result may or may not be used by the system
110 call. Only the right half of a non-immediate control bit
111 parameter is significant. Some system calls XOR the left
112 half of their first argument with the control bits as well.
113 \f
114 FAILURE CODES:  Returned by New System CALLs (and .OPEN's, etc.)
115
116 The failure code from a new system call that doesn't skip can be
117 obtained by reading the .USET variable .BCHN to find the number of
118 the channel on which the code was returned, and then reading
119 that channel's .IOS variable (using the .STATUS uuo or
120 the STATUS symbolic call) to get a word with the error code
121 in bits 3.6-3.1.
122
123 Alternatively an error return code argument may be specified and the error
124 code will be stored right-justified (not in bits 3.6-3.1, but bits 1.6-1.1).
125 To get the corresponding message from the ERR device, use a first file
126 name of 4 (number, not sixbit) and use the error code as the second file name.
127
128 The error codes which may be returned by each individual call are described
129 in the documentation for that call.  Note that if the call is interpreted
130 by a job device, any error code may be returned, not just those documented;
131 job devices should, however, adhere as closely as possible to normal
132 error code conventions.  Errors codes 15, 30, 43, and 44 may be returned by
133 any symbolic system call, and so are not included under the individual
134 descriptions.
135
136 The ERR device can be used to get a corresponding message as indicated in
137 the table on the following page.  See the OPEN system call for information
138 on the ERR device.
139
140 The error codes have symbolic names, which are pre-defined in DDT and
141 MIDAS.  The first two characters in the name are "%E".  The remaining
142 letters usually follow the following conventions.  3rd and 4th letters:
143 "TM" = "too many", "BD" = "bad or illegal", "TF" = "too few", "RO" =
144 "read-only", "NA" = "not available", "NS" = "no such", "EX" = "already
145 exists", "FL" = "full", "NR" = "not ready".  5th and 6th letters: "JB" =
146 "job", "RG" = "arg", "DV" = "device", "DR" = "directory", "IO" =
147 "direction", "FL" = "file", "FN" = "file name".
148 \f
149 ERROR CODES:
150
151 Number  Symbolic        Message
152 ------  --------        -------
153 1       %ENSDV          NO SUCH DEVICE
154 2       %ENSIO          WRONG DIRECTION
155 3       %ETMTR          TOO MANY TRANSLATIONS
156 4       %ENSFL          FILE NOT FOUND
157 5       %EFLDR          DIRECTORY FULL
158 6       %EFLDV          DEVICE FULL
159 7       %ENRDV          DEVICE NOT READY
160 10      %ENADV          DEVICE NOT AVAILABLE
161 11      %EBDFN          ILLEGAL FILE NAME
162 12      %ENSMD          MODE NOT AVAILABLE
163 13      %EEXFL          FILE ALREADY EXISTS
164 14      %EBDCH          BAD CHANNEL NUMBER
165 15      %ETMRG          TOO MANY ARGUMENTS
166 16      %ENAPK          PACK NOT MOUNTED
167 17      %ENADR          DIRECTORY NOT AVAIL
168 20      %ENSDR          NON-EXISTENT DIRECTORY
169 21      %ELCDV          LOCAL DEVICE ONLY
170 22      %ESCO           SELF-CONTRADICTORY OPEN
171 23      %ENAFL          FILE LOCKED
172 24      %ETMDR          M.F.D. FULL
173 25      %EMCHN          DEVICE NOT ASSIGNABLE TO THIS PROCESSOR
174 26      %ERODV          DEVICE WRITE-LOCKED
175 27      %ETMLK          LINK DEPTH EXCEEDED
176 30      %ETFRG          TOO FEW ARGUMENTS
177 31      %EROJB          CAN'T MODIFY JOB
178 32      %EROPG          CAN'T GET THAT ACCESS TO PAGE
179 33      %EBDRG          MEANINGLESS ARGS
180 34      %EBDDV          WRONG TYPE DEVICE
181 35      %ENSJB          NO SUCH JOB
182 36      %EBOJ           VALID CLEAR OR STORED SET
183 37      %ENACR          NO CORE AVAILABLE
184 40      %ETOP           NOT TOP LEVEL
185 41      %ENAPP          OTHER END OF PIPELINE GONE OR NOT OPEN
186 42      %ENAJB          JOB GONE OR GOING AWAY
187 43      %ENSCL          ILLEGAL SYSTEM CALL NAME
188 44      %ENSCH          CHANNEL NOT OPEN
189 45      %ENRBF          INPUT BUFFER EMPTY OR OUTPUT BUFFER FULL
190 46      %EBDFL          UNRECOGNIZABLE FILE
191 47      %EBDLK          LINK TO NON-EXISTENT FILE
192 \f
193 ARGS:   Special Common Types of Arguments
194
195 <TTY>   TTY channel #
196         STY channel #  (accesses TTY which is STY's alter ego)
197         400000 + TTY #  (may be used to examine TTY variables,
198                 but not to alter them or to transact input/output)
199
200 <JOB>   channel # for USR device
201         channel # for JOB device (means job on other end,
202                 unless argument may also be a <JOBDEV>, in which
203                 case the job device will interpret things)
204         channel # for BOJ device (means calling job)
205         channel # for STY device (means job possessing
206                 the corresponding TTY)
207         400000 + job # (user index)
208         -1 or 777777 specifies self.
209         400377 specifies superior.
210         400376 specifies the pdp6.
211
212         The symbols %JSELF (777777), %JSNUM (400000), %JSSIX (400376),
213         and %JSSUP (400377) are pre-defined in MIDAS and DDT.
214         Various other symbols beginning with %JS are defined
215         for special codes that can be used instead of a
216         <JOB> spec with certain calls; they are documented
217         under those calls.
218
219 <JOBDEV>        channel # for JOB device
220
221         Many symbolic system calls which take a channel number
222         as the first argument may be passed to JOB devices
223         for interpretation by that device.  A few act on the device
224         itself, and are not passed for interpretation.  Those
225         passed for interpretation include:
226                 ACCESS          CNSGET          CNSSET
227                 DIRSIZ          DSKUPD          FILBLK
228                 FILLEN          FINISH          FORCE
229                 JOBCAL          JOBGET          JOBINT
230                 JOBIOC          JOBRET          JOBSTS
231                 LISTEN          NETAC           NETBLK
232                 NETINT          RAUTH           RHCST
233                 RCPOS           RDMPBT          RENMWO
234                 RESET           RESRDT          RFDATE
235                 RFPNTR          RSSIZE          SAUTH
236                 SCML            SCPOS           SDMPBT
237                 SETIOC          SFDATE          SRDATE
238                 SREAPB          STLGET          STYGET
239                 TTYGET          TTYSET          TTYVAR
240                 TVWHER          WHOLIN          WHYINT
241
242         The JOB device may of course interpret such calls in
243         any way desired, and return any results desired.
244         It is of course advisable to adhere as closely to
245         the standard actions of each call as possible.
246
247         Most of the above calls simply pass the symbolic
248         call name and arguments along to the JOB device.  The
249         following have special interfaces for historical reasons:
250
251                 ACCESS          RCHST           RENMWO
252                 RESET
253
254         The following calls can open up a JOB device if their
255         sixbit device name argument is not the name of a
256         device that is built into the system:
257
258                 DELETE          MLINK           OPEN
259                 RENAME
260
261         Those calls which are definitely NOT passed for
262         interpretation include:
263                 CLOSE
264                 IOT
265                 SIOT
266                 STATUS
267                 RFNAME
268                 IOPUSH
269                 IOPOP
270         These calls interact with the JOB device in another way.
271
272 A number of these calls include special bits and fields in their
273 arguments or return values.  Several files exist which contain
274 symbolic definitions of these bits and fields.  These files
275 can be inserted into a MIDAS program with .INSRT.  In addition,
276 most of the symbols are predefined in MIDAS and DDT through
277 a symbol table in the system.  The symbols defined are the same
278 as used in this documentation.
279
280 The following files exist on the SYSENG directory.
281
282         FSDEFS >        Bits in fields used by the file system,
283                         including the format of directories.
284         ITS BITS        Miscellaneous bits and codes.
285
286 The following errors are standard for all calls that take <JOB>
287 arguments, and are generally not documented under the individual
288 calls:
289
290  14     BAD CHANNEL NUMBER
291         The argument was not a special negative code, not
292         400000+a user number, and not a valid channel number.
293  33     MEANINGLESS ARGS
294         A random number that could not be decoded was given
295         as a <JOB> argument.
296  34     WRONG TYPE DEVICE
297         A channel number was specified that did not have open an
298         appropriate type of device (generally USR, STY, or BOJ).
299  35     NO SUCH JOB
300         400000+user number was specified, but the user number
301         did not correspond to a currently-existing job, or
302         400377 was given, specifying the superior, but the job
303         was top-level.
304  41     OTHER END OF PIPELINE GONE OR NOT OPEN
305         A STY channel number was specified, but the corresponding
306         TTY was free and had no associated job.
307  42     JOB GONE OR GOING AWAY
308         The specified job exists but is in process of being killed.
309
310 The following errors are standard for all calls that take <TTY> arguments: 
311
312   1     NO SUCH DEVICE
313         400000+tty number was specified, but there is no tty with the
314         indicated number.
315  14     BAD CHANNEL NUMBER
316         The argument was not 400000+tty number and was not a valid
317         channel number.
318  34     WRONG TYPE DEVICE
319         A channel number argument does not refer to a channel open
320         to a STY or a TTY.
321  44     CHANNEL NOT OPEN
322         The specified channel is not open.
323 \f
324 ACCESS: set file access pointer
325
326         arg 1   Channel number.
327         arg 2   New access pointer.  This pointer is
328                 the number of bytes from the beginning
329                 of the file of the next byte to be
330                 processed.  Note that in block mode,
331                 even ASCII block mode, a byte is always
332                 a full word.
333
334         This is useful primarily for DSK and disk-like job devices;
335         that is, any device which has "files."
336         
337         See also the .ACCESS uuo.
338
339 Errors:
340
341  14     BAD CHANNEL NUMBER
342
343  If the ACCESS pointer is set to more than the number of words in
344  in the file, an IOC error 2 will occur on the next IOT operation
345  on that channel.
346 \f
347 ATTACH: attach a job-tree to a console                          (ITS DETACH)
348
349         cbits   2.9     If there are 2 args, causes the jname
350                         of the job being attached to be changed
351                         to HACTRN, unless there is already a HACTRN.
352                 1.3     "\eP" the job by clearing bit 4.4 of .USTP
353         arg 1   <JOB> to be attached to the console.
354         arg 2   Optional: <TTY> to attach it to.  Must be free.
355                 If not present, the executing job must be
356                 top-level and console-controlled; it is logged
357                 out, and its console used as the tty to attach to.
358
359         Attaching a job tree to a tty causes the job tree to be
360         console-controlled with the specified tty as its console.
361         The specified job must be either the top-level job of
362         a disowned job tree, or a direct inferior of the job executing
363         the ATTACH; in the latter case the specified job is disowned
364         first.  The tty to be attached to must be free.  In the
365         one-argument case the job executing the ATTACH must be the
366         top-level job of a console-controlled job tree; it is logged
367         out to make the console free.  The one-argument case furthermore
368         causes the attached job to take on the jname of the job
369         executing the ATTACH.  In the 2-argument case, control bit
370         400000 causes the attached job to take on the jname HACTRN,
371         unless that would cause it to have the same names as an
372         existing job.
373
374         The one-argument case is made available in DDT via the
375         command :ATTACH, which attaches the current job to the console.
376         Also, when a user logs in (say as FOO), DDT checks for the
377         existence of a job called FOO HACTRO; if it exists, DDT asks:
378                 --ATTACH YOUR DETACHED JOB--
379         If at this point the user types a space, DDT executes the
380         commands "HACTRO\eJ :ATTACH ", thereby attaching the HACTRO to
381         the console, and changing the HACTRO's name to HACTRN.
382         This affords a convenient method of recovery from automatic
383         detachment.
384
385         See the DETACH symbolic system call.
386
387 Errors:
388
389  10     DEVICE NOT AVAILABLE
390         This job's tree is not console-controlled (one argument);
391         the specified tty is not free or does not exist (two arguments).
392  14     BAD CHANNEL NUMBER
393         The first argument is not a valid channel number.
394  31     CAN'T MODIFY JOB
395         The specified job is not disowned or a direct inferior.
396  34     WRONG TYPE DEVICE
397         First argument must be a job.
398  35     NO SUCH JOB
399         First argument specified a non-existent job.
400  40     NOT TOP LEVEL
401         The executing job must be a top-level job (one argument).
402 \f
403 ATTY:   pass tty to inferior
404
405         arg 1   <JOB>
406
407         The tree's console tty is passed to the <JOB>, which must
408         be a direct inferior.  This is the same as the .ATTY uuo.
409
410 Errors:
411
412 31      CAN'T MODIFY JOB
413         The specified job is not a direct inferior.
414
415 34      WRONG TYPE DEVICE
416         The specified job is the pdp-6.
417
418 42      JOB GONE OR GOING AWAY
419         The specified job is dying.
420 \f
421 CALL:   perform system call
422
423         arg 1   Name of symbolic system call to perform.
424
425         The other arguments serve as the arguments to the
426         specified symbolic call.  The values and errors returned by
427         that call become the values and errors of this call.
428         This is useful if the name of a symbolic call is to be
429         determined dynamically.  Lisp hackers should think of this
430         as the "Funcall" system call.
431 \f
432 CHAOSO: open Chaosnet connection                <MOON;CHAORD>
433
434         arg 1 - receive channel number
435         arg 2 - transmit channel number
436         arg 3 - receive window size
437
438         First, the two specified channels are closed.  Then an index
439         is assigned to the user and the two channels are set up to
440         point to it.  Two channels are used since in general ITS
441         channels are unidirectional, and to allow to the user to
442         handle receive and transmit interrupts differently.
443
444         The created index is placed in the Closed state.  To set up
445         a connection, IOT an RFC or LSN packet down the transmit
446         channel.
447 \f
448 CHAOSQ: Chaosnet Queue                                  <MOON;CHAORD>
449
450         arg 1 - address of a 126.-word block (packet buffer)
451
452         This is a special system call for use by the ATSIGN CHAOS
453         program, which is a daemon program that gets run when
454         an RFC is received that does not match up against an
455         existing LSN.  
456
457         The first packet on the pending-RFC queue is copied
458         into the packet buffer, then moved to the end of the
459         queue (so that the right thing happens when several
460         RFC's are pending at the same time.)
461
462         The call fails if the pending-RFC queue is empty.
463
464         The program should use the contact name in this
465         packet to choose a server program to execute.  This
466         server program will then LSN to (presumably) the same
467         contact name, thus picking up the RFC.
468 \f
469 CLOSE:  close input/output channel
470
471         arg 1   Channel number to close.
472
473         The specified input/output channel is closed.
474
475         For TCP connections:
476         A CLOSE on the output channel will cause an automatic FORCE,
477         and a FIN segment will be sent to the remote host indicating
478         "no more data to send".  However, the input channel will
479         remain open, and data can continue to be read from it.
480         A CLOSE on the input channel will cause any further input received
481         to be thrown away by ITS.  Output can continue to be sent.
482         Return from this call is immediate; it will not hang.  Note that,
483         like NCP, this does not allow the user to determine
484         whether the last stuff successfully reached the destination or
485         not.  When this is desirable, a FINISH should be done prior to
486         the CLOSE.
487
488 For the Chaosnet:
489         Immediately closes the connection.  All buffers and other
490         information associated with the index are discarded.  Normally
491         the user should first IOT a CLS
492         packet containing an ascii explanation for why it is
493         closing.  Note that any data previously written on the
494         connection but not yet received by the other end will be
495         lost.  The system will attempt to send a CLS with reason
496         "channel closed", but this will only be sent if buffer space
497         is available.
498
499         See also the .CLOSE uuo.
500 \f
501 CNSGET: get various console parameters                          (ITS TTY)
502
503         arg 1   <TTY> or <JOBDEV>
504         val 1   Vertical screen size.
505         val 2   Horizontal screen size.
506         val 3   TCTYP variable.
507                 0       %TNPRT  Printing terminal.
508                 1       %TNDP   Good Datapoint.
509                 2       %TNODP  Bad Datapoint ("loser").
510                 3       %TNIML  Imlac.
511                 4       %TNTEK  Tektronix.
512                 5       %TNTV   PDP-11 TV.
513                 6       %TNMEM  Memowreck.
514                 7       %TNSFW  Software terminal (accepts internal
515                                 ITS display codes, such as live in
516                                 internal terminal output buffers;
517                                 see ITS TTY for details).
518                 10      %TNTRM  Terminet.
519                 11      %TNESC  Display using ASCII standard display codes.
520                 12      %TNDTM  Datamedia.
521                 13      %TNRAY  Teleray 1061
522                 14      %TNHDS  Concept 100
523                 15      %TNH19  H19
524                 16      %TNAAA  Ann Arbor Ambassador
525         val 4   TTYCOM variable.
526                 4.9             Communicate mode.
527                 4.8     %TCLFT  Local feed through (my job sees his typing).
528                 4.7     %TCRFT  Remote feed through (his job sees my typing).
529                 4.6     %TCICO  Input comm override (my job sees my typing).
530                 4.5     %TCOCO  Output comm override (I see my job's typing).
531                 4.4     %TCRFS  Refuse comm messages.
532                 4.3     %TCQRY  Query me if comm attempted to me.
533                 4.2     %TCMTR  The tty's motor is off, and must be
534                                 turned on before next output.
535                                 (Currently only Terminets get turned off.)
536                 4.1     %TCECH  The last output to this tty was PI echo.
537                 3.9     %TCINP  Someone waited for input since last home-up.
538                 3.8     %TCDET  Console's tree detached by top level interrupt.
539                 3.7     %TCDNG  Type bell (input buffer full).
540                 3.6     %TCCBK  Reading uname or tty number after ^_K.
541                 3.5     %TCCBS  Reading uname or tty number after ^_S.
542                 3.4     %TCFPD  First part of an output code sequence is done.
543                 3.3     %TCTPN  Type ^_N on leaving comm (unless user types it).
544                 3.2     %TCPAD  0 => padding necessary on datapoint.
545                 3.1     %TCHNG  Done flag seems to be fried - time out quickly.
546                 2.9-1.1 -1 if not in comm mode; otherwise number of
547                         next tty in circular list of those in comm mode
548                         together.
549         val 5   TTYOPT variable.
550                 4.8     %TOALT  Standardize altmodes.
551                 4.7     %TOCLC  Convert lower case input to upper case.
552                 4.6     %TOERS  This tty can selectively erase.
553                 4.5     %TOHDX  This tty is half-duplex.
554                 4.4     %TOMVB  This tty can backspace directly.
555                 4.3     %TOSAI  This tty handles SAIL characters.
556                 4.2     %TOSA1  Used to initialize %TSSAI for new jobs.
557                 4.1     %TOOVR  This tty can overprint correctly.
558                 3.9     %TOMVU  This tty can move its cursor upward.
559                 3.8     %TOMOR  Used to initialize %TSMOR for new jobs.
560                 3.7     %TOROL  Used to initialize %TSROL for new jobs.
561                 3.6     %TORAW  Don't optimize cursor motion.
562                 3.5     %TOLWR  This tty has a lower case keyboard.
563                 3.4     %TOFCI  This tty's keyboard has the full TV character set.
564                 3.3     %TOIML  This tty acts like an IMLAC.
565                 2.9-2.7 $TPPLF  How to pad line feeds:
566                                 0       Don't.
567                                 1       Two pad chars (Memorex, 2741).
568                                 2       Terminet.
569                 2.6-2.4 $TPPCR  How to pad carriage returns:
570                                 0       Don't.          4       Execuport.
571                                 1       Normal.         5       2741.
572                                 2       Double.         6       Memorex.
573                                 3       Unused.         7       Unused.
574                                 For a Datapoint, number of pad chars before
575                                 each string of cursor motion commands.
576                                 For a Terminet, 0=no padding, 1,2,3,4,5
577                                 correspond to 10,15,30,60,120 cps.
578                 2.3-2.1 $TPPTB  How to pad tabs:
579                                 0       Tabs not allowed.
580                                 <n>     Use <n-1> pad chars.
581                                 On displays,
582                                 0       don't use tabs.
583                                 1       use tabs.
584                                 2       use VT52-style absolute positioning.
585                 1.6     %TPCBS  The ^\ intelligent terminal protocol is enabled.
586                 1.5     %TP11T  PDP-11 TV.  Reflects %TY11T.
587                 1.4     %TPORS  Output reset really does something.
588                 1.3     %TPRSC  This tty can do region scrolling
589                 1.2     %TPIBC  Oddball 2741-like tty.
590                 1.1     %TPIBM  It really is a 2741.
591         val 6   TTYTYP variable.
592                 4.9     %TTLCL  Local tty (i.e. right near the PDP-10).
593                 4.8     %TT340  Near the 340 or a 340 slave.
594                 4.7     %TT3HP  High priority for grabbing 340.
595                 4.3     %TTPAR  Tty needs a parity bit generated by software.
596                 4.2     %TTDDI  Don't ding bell on excess input.
597                 4.1     %TTIBM  Datel (2741) line.
598                 3.8-3.5 $TTISP  Input speed code:
599                 0 = unknown             6 = 1800 baud           13 = 40K baud
600                 1 = 600 baud            7 = 2400 baud           14 = 50K baud
601                 2 = 110 baud           10 = 4800 baud           15 = 80K baud
602                 3 = 150 baud           11 = 9600 baud           16 unused
603                 4 = 300 baud           12 = 25K baud            17 unused
604                 5 = 1200 baud
605                 3.4-3.1 $TTOSP  Output speed code, as above.
606                 2.9     %TYDPK  Datapoint controller line.
607                 2.8     %TYSTY  Alter ego to a STY.
608                 2.7     %TYNVA  Nova tty (requiescat in pace).
609                 2.6     %TYMTY  Morton controller line.
610                 2.5     %TYDIL  Dial-up line.
611                 2.4     %TY11T  PDP-11 TV tty.
612                 2.3     %TYDL   DL-10 tty.
613                 2.2     %TYOTY  KA-10 console tty.
614                 2.1     %TYETY  DTE-20 tty.
615                 1.9     %TYNTY  TK-10 tty.
616                 1.8     %TYMDM  Dial-up line with modem control.
617                 1.7     %TYKST  KS-10 console tty.
618                 1.6     %TYDZT  DZ-11 tty on a KS-10.
619                 1.5     %TYRLM  ROLM data switch tty.
620         val 7   TTYSMT variable.
621                 4.9-4.7 %TQMCH  Machine type
622                   0 = nothing special   1 = PDP11               2 = PDS4
623                   3 = PDS1
624                 4.6-4.2 %TQHGT  Character height in dots
625                 4.1-3.7 %TQWID  Character width in dots
626                 3.6     %TQVIR  Terminal implements virtual coordinates
627                 3.5     %TQBNK  Terminal implements blinking
628                 3.4     %TQXOR  Terminal implements XOR mode
629                 3.3     %TQREC  Terminal implements rectangle commands
630                 3.2     %TQSET  Terminal implements multiple object sets
631                 3.1     %TQGRF  Terminal understands graphics protocol
632                 2.9     %TRGIN  Terminal has graphic imput
633                 2.8     %TRGHC  Terminal has graphic hardcopy
634                 2.7     %TRLED  Terminal has local editing protocol
635                 2.6     %TRSCN  Terminal implements raster commands
636                 2.5-2.3 %TRLSV  <>0 means terminal supports 4**N saved lines
637                 2.2-1.7 %TRTIM  signed offset from GMT minus 20 or zero if
638                                 terminal's timezone is unknowable.
639
640         See also the CNSSET, TTYGET, and TTYSET symbolic system calls.
641 \f
642 CNSSET: set various console parameters                          (ITS TTY)
643
644         arg 1   <TTY> or <JOBDEV>
645         arg 2   Vertical screen size (negative => no change).
646         arg 3   Horizontal screen size (negative => no change).
647         arg 4   TCTYP variable (negative => no change).
648                 0       %TNPRT  Printing terminal.
649                 1       %TNDP   Good Datapoint.
650                 2       %TNODP  Bad Datapoint ("loser").
651                 3       %TNIML  Imlac.
652                 4       %TNTEK  Tektronix.
653                 5       %TNTV   PDP-11 TV.
654                 6       %TNMEM  Memowreck.
655                 7       %TNSFW  Software terminal (accepts internal
656                                 ITS display codes, such as live in
657                                 internal terminal output buffers;
658                                 see ITS TTY for details).
659                 10      %TNTRM  Terminet.
660                 11      %TNESC  Display using ASCII standard display codes.
661                 12      %TNDTM  Datamedia.
662                 13      %TNRAY  Teleray 1061
663                 14      %TNHDS  Concept 100
664                 15      %TNH19  H19
665                 16      %TNAAA  Ann Arbor Ambassador
666         arg 5   TTYCOM variable.
667                 4.6     %TCICO  Input comm override (my job sees my typing).
668                 4.5     %TCOCO  Output comm override (I see my job's typing).
669                 4.4     %TCRFS  Refuse comm messages.
670                 4.3     %TCQRY  Query me if comm attempted to me.
671                 4.2     %TCMTR  The tty's motor is off, and must be
672                                 turned on before next output.
673                                 (Currently only Terminets get turned off.)
674                 3.9     %TCINP  Someone waited for input since last home-up.
675                 The remaining bits, documented under CNSGET, may not be changed.
676         arg 6   TTYOPT variable.
677                 4.8     %TOALT  Standardize altmodes.
678                 4.7     %TOCLC  Convert lower case input to upper case.
679                 4.6     %TOERS  This tty can selectively erase.
680                 4.5     %TOHDX  This tty is half-duplex.
681                 4.4     %TOMVB  This tty can backspace directly.
682                 4.3     %TOSAI  This tty handles SAIL characters.
683                 4.2     %TOSA1  Used to initialize %TSSAI for new jobs.
684                 4.1     %TOOVR  This tty can overprint correctly.
685                 3.9     %TOMVU  This tty can move its cursor upward.
686                 3.8     %TOMOR  Used to initialize %TSMOR for new jobs.
687                 3.7     %TOROL  Used to initialize %TSROL for new jobs.
688                 3.6     %TORAW  Don't optimize cursor motion.
689                 3.5     %TOLWR  This tty has a lower case keyboard.
690                 3.4     %TOFCI  This tty's keyboard has the full TV character set.
691                 3.3     %TOIML  This tty acts like an IMLAC.
692                 2.9-2.7 $TPPLF  How to pad line feeds:
693                                 0       Don't.
694                                 1       Two pad chars (Memorex, 2741).
695                                 2       Terminet.
696                 2.6-2.4 $TPPCR  How to pad carriage returns:
697                                 0       Don't.          4       Execuport.
698                                 1       Normal.         5       2741.
699                                 2       Double.         6       Memorex.
700                                 3       Unused.         7       Unused.
701                                 For a Datapoint, number of pad chars before
702                                 each string of cursor motion commands.
703                                 For a Terminet, 0=no padding, 1,2,3,4,5
704                                 correspond to 10,15,30,60,120 cps.
705                 2.3-2.1 $TPPTB  How to pad tabs:
706                                 0       Tabs not allowed.
707                                 <n>     Use <n-1> pad chars.
708                                 On displays,
709                                 0       don't use tabs.
710                                 1       use tabs.
711                                 2       use VT52-style absolute positioning.
712                 1.6     %TPCBS  The ^\ intelligent terminal protocol is enabled.
713                 1.5     %TP11T  PDP-11 TV.  Reflects %TY11T.
714                 1.4     %TPORS  Output reset really does something.
715                 1.3     %TPRSC  This tty can do region scrolling.
716                 1.2     %TPIBC  Oddball 2741-like tty.
717                 1.1     %TPIBM  It really is a 2741.
718
719         Omitting an argument also means no change (only works
720         if all arguments after it are also omitted, of course.)
721         Not all bits of the variables are settable;  those explicitly
722         not user-settable have been omitted above.  If contradictory
723         bits are supplied, the system will reconcile the conflicts.
724         See also the CNSGET, TTYGET, and TTYSET symbolic system calls.
725 \f
726 CORBLK: modify blocks of core in page map                       (ITS CORBLK)
727
728         cbits   2.9     %CBWRT  Try to get write access; okay if can't.
729                 2.8     %CBRED  Try to get read access; okay if can't.
730                 2.7     %CBNDW  Try to get write access; fail if can't.
731                 2.6     %CBPUB  Make page public.  This operation fails if
732                           an attempt to get write access would fail;
733                           however, it does not actually get write
734                           access unless bit 2.7 is set also.
735                           Any job is allowed to get write access to
736                           a public page.
737                 2.5     %CBPRV  Make page private.  This operation fails if
738                           an attempt to get write access would fail;
739                           however, it does not actually get write
740                           access unless bit 2.7 is set also.
741                           A job can have write access to a private page
742                           only if it is getting the page from itself or
743                           a job it is allowed to write in, and that job
744                           has write access itself.  Pages are usually private.
745                 2.4     %CBNDR  Fail if can't get read access
746                           (attempting to share with a non-existent page).
747                 2.3     %CBCPY  Make a copy (disk files only).
748                 2.2     %CBLOK  Lock page in core (don't allow swap out.)
749                 2.1     %CBULK  Unlock page from core.
750                 1.9     %CBSLO  Force page to reside in slowest memory.
751                                 This is useful when trying to get
752                                 reproduceable run time measurements.
753                 1.8     %CBUSL  Undo the effect of %CBSLO                       
754                 Bits 2.2-1.8 are not yet implemented.
755                 All zero means delete page from page map.
756         arg 1   RH and LH are XOR'd with control bits.
757         arg 2   <JOB> to put page into (or delete it from).
758         arg 3   Page number within job specified by arg 2.
759                 If LH negative, block mode operation:
760                 After doing operation, increment arg 5 if any,
761                 AOBJN arg 3, write args back into user core,
762                 and repeat the operation, until LH of arg 3
763                 becomes positive.
764         arg 4   Any one of the following:
765                         <JOB> to get page from.
766                         Disk channel number.
767                                 When disk file pages are inserted,
768                                 the access pointer is left pointing
769                                 after the last word of the last page
770                                 inserted.
771                                 If the pages so inserted are inserted
772                                 with write access for modification,
773                                 the DSKUPD symbolic system call may
774                                 be used to set the creation and
775                                 reference dates for the file.
776                         PDP-6 channel number.
777                         One of the following special negative codes.
778                         Only the right-half matters.
779                         -2 %JSTVB means video buffer pages.
780                                 Pages 0-7 are video buffer.
781                                 First word of page 10 contains
782                                 console register and ALU.
783                                 See the .TVCREG user variable,
784                                 and the VIDBUF and VIDSW symbolic
785                                 system calls.
786                         -5 %JSNEW get a fresh page.  A new page, not
787                                 shared with any other, will be created.
788                                 The system tries to zero it out, but
789                                 currently may fail to if there is already
790                                 a page at the destination address.  If
791                                 wasn't very difficult to fix, I'd fix it
792                                 instead of documenting it.
793                         -6 %JSABS an absolute page.  Arg 5 specifies the
794                                 desired page of physical memory.  You are
795                                 not permitted write access to such a page.
796                         400000 specifies the system job (job # 0).  Sharing
797                                 a page with the system job is almost like
798                                 getting an absolute page via %JSABS, since
799                                 the system job's address space mostly
800                                 corresponds to physical memory.
801                         400001 specifies the core job.  For historical
802                                 reasons, this is taken to mean get a fresh
803                                 page instead.  This special case will go
804                                 away some day, so use %JSNEW instead.
805                 If arg 4 is omitted, it is the same as arg 2.
806         arg 5   Page number within source specified by arg 4.
807                 Arg 5 is ignored for fresh page.
808                 If omitted, same as arg 3 if source is a job.
809                 If source is a disk file, the current access
810                 pointer rounded down to a page boundary
811                 is the default.
812
813 Errors:
814
815  10     DEVICE NOT AVAILABLE
816         PDP-11 TV not available for mapping.
817  14     BAD CHANNEL NUMBER
818         Argument 2 or 4 is invalid.
819  31     CAN'T MODIFY JOB
820         Executing job doesn't have modification rights to the job
821         specified by argument 2.
822  32     CAN'T GET THAT ACCESS TO PAGE
823         Can't satisfy access requested by cbits 2.7-2.4.
824         This usually means that the page does not exist in the
825         source specified in argument 4, or that it exists but
826         write access is not permissible.  It may also mean that
827         an absolute page which normally exists is currently down.
828  33     MEANINGLESS ARGS
829         Page number outside range 0-377 for another job's page,
830         or outside 0-10 for a video buffer page,
831         or outside 0-17 for a PDP-6 page.
832         The allowed range for absolute pages depends on the machine.
833  34     WRONG TYPE DEVICE
834         Can't map pages from any device other than those listed above.
835  35     NO SUCH JOB
836         Argument 2 or 4 specified a non-existent job.
837  37     NO CORE AVAILABLE
838         Tried to get fresh page, but no more (virtual) core is available.
839         The total number of distinct pages in the system is limited
840         by the size of the MMP table.
841 \f
842 CORTYP: determine type info from page map                       (ITS CORBLK)
843
844 If one argument:
845         arg 1   Page number within current job.
846 If two arguments:
847         arg 1   <JOB>
848         arg 2   Page number within specified job.
849         val 1   4.9     %CBWRT    Page is writable.
850                 4.8     %CBRED    Page is readable (exists).
851                 4.6     %CBPUB    Page is public (writable by anyone)
852                 4.2     %CBLOK    page is locked in core
853                                   (inhibited from swapout)
854                 3.9     %CBSLO    Page is in slow memory
855                                   (Doesn't work; Moon says it never will)
856                 For non-existent page, whole word is zero.
857                 Thus, this value is:
858                         zero => no page.
859                         positive => read-only page,
860                         negative => writable page.
861         val 2   0       Absolute page.
862                 -1      Unshared page.
863                 other   User index of next job in circular
864                         list of jobs sharing the page.
865         val 3   For val 2 = 0, absolute page number.
866                 For val 2 = -1, zero.
867                 Otherwise, page number within job specified
868                 by val 2.
869         val 4   4.9     Page is in core.
870                 2.9-1.1 Number of times page is shared (zero
871                         for absolute or non-existent page,
872                         else >=1 ).
873
874 Errors:
875
876  14     BAD CHANNEL NUMBER
877  33     MEANINGLESS ARGS
878         Page number was outside range 0-377.
879  34     WRONG TYPE DEVICE
880         Channel not open on USR, BOJ, JOB, or STY device.
881  35     NO SUCH JOB
882 \f
883 DELETE: delete a file
884
885   Either
886         arg 1   Byte pointer to ASCIZ filename string,
887                 or aobjn pointer to block of such byte pointers.
888
889   or
890         arg 1   Left-justified device name, in SIXBIT.
891         arg 2   File name 1 in SIXBIT.
892         arg 3   File name 2 in SIXBIT.
893         arg 4   Sname in SIXBIT.
894
895         The file specified either by the four SIXBIT names or by the
896         ASCIZ string(s) is deleted.
897
898         See the SOPEN symbolic system call for how the byte or AOBJN
899         pointer argument should be formatted and how the string(s) are
900         parsed.
901 \f
902 DELEWO: Delete file While Open.
903
904         arg 1   Channel number.
905
906         The file open on the channel is marked for deletion.
907         It is actually deleted as soon as all channels referencing
908         it (including the one used by the DELEWO) are closed.
909         In the meantime, it is inaccessible (starred in the directory).
910         Either an input channel or an output channel can be used.
911
912 Errors:
913
914  34     WRONG TYPE DEVICE
915         This call works only on DSK, and such job devices as simulate DSK.
916 \f
917 DEMSIG: demon signal
918
919         arg 1   Sixbit name of demon to signal.
920         arg 2   Optional:
921                 zero => signal once only.
922                 positive => signal repeatedly every 2*n minutes.
923                 negative => load demon but do not signal.
924
925         A demon is a program which runs (and perhaps even exists)
926         only when a request has been signaled for it.  If the
927         demon with the specified demon is not currently running,
928         the system job creates a demon job and loads it from the
929         file SYS:ATSIGN <name>, where <name> is the name of the
930         demon.
931         When the demon runs, it can acknowledge receipt of one
932         or more signals by using the .DEMON uuo (q.v.).
933         The status of a demon can be examined and altered by
934         using the RDDMST and STDMST symbolic system calls.
935         When the system is started up, there is a once-only
936         signal for the DEMSTR demon pending; this demon normally
937         signals requests for all other standard systemic demons.
938
939         Demons were much used on the DM machine for various purposes.
940         Standard demons which are started by the DEMSTR demon include
941         (as of July 23, 1975):
942         NAME    REPT RATE       PURPOSE
943         TCTYP   0               Set terminal types?? (Doesn't exist on SYS)
944         UNSPOO  0               Line printer unspooler (TPL).
945         SURVEY  10.             Network survey generator.
946         LDRDEM  0               Loader demon (obsolete).
947         BATCHM  0               Old batch monitor (obsolete).
948         COMSYS  0               Old message demon (obsolete).
949         NETRJS  0               CCN remote job server demon.
950         ZONE    0               MUDDLE compile batcher.
951         MG      0               Maze Guncher - kills games of MAZE
952                                 in an obscure way.  AV doesn't like them.
953         COMDMN  0               Communications demon (replaces COMSYS).
954         BATCHN  0               Batch monitor (replaces BATCHM).
955         RFC402  0               Message archival demon.
956 \f
957 DETACH: detach a job tree from a console                        (ITS DETACH)
958
959         arg 1   <JOB> for any job in the tree to be detached.
960                 If omitted, the tree referred to is that
961                 of the executing job.
962         cbits   1.1     Leave the detached tree as a non-disowned,
963                         non-console-controlled tree, instead of as
964                         a disowned tree.
965                 1.2     Use system tree's resource word instead
966                         of disowned resource word.  This is to
967                         be used only by legitimate system daemons.
968                 1.3     "\eP" the job by clearing bit 4.4 of .USTP
969                 1.4     if an hour goes by and the detached tree
970                         does not run and is not reowned or attached,
971                         it will be killed automatically by the system.
972                 1.5     suppress the console-free message that would
973                         otherwise be printed on the tree's console.
974         The entire job tree which the specified job belongs
975         to is made to be disowned.  If it was controlled by
976         a console, that console is made free.  If the tree is
977         already disowned, nothing happens, but the DETACH call
978         skips anyway.  If the top level job of the tree has a
979         jname of HACTRN, the jname is incremented to be HACTRO
980         and then re-incremented as necessary to make its uname-
981         jname pair unique.
982
983         DDT provides a command :DETACH which detaches the tree
984         the DDT itself is in.  LOCK provides a DETACH command
985         for detaching other trees conveniently:
986         <n>DETACH               detaches the tree containing the
987                                 job with user index <n>.
988         DETACH<uname> <jname>   detaches the tree containing
989                                 the job named <uname> <jname>.
990
991         Automatic detachment by the system job:
992         Fatal interrupts in top-level jobs will cause them to be stopped
993         and then detached by the system job, which will type the message
994                 TOP LEVEL INTERRUPT, TREE DETACHED
995         on the console detached from, followed by the normal
996         console-free message.  A message is also printed on the system
997         console saying which job was detached from which terminal.
998
999         If the PDP-11 controlling the TV consoles crashes, the system
1000         job automatically detaches all job trees controlled by TV
1001         consoles.  This allows the user to log back in and re-attach
1002         his job tree when the PDP-11 is restarted.
1003         If the ARPA network crashes (that is, the local network
1004         attachment crashes, or the host which is connected to
1005         the console of a particular console-controlled tree 
1006         crashes) the server telnets automatically detach those
1007         job trees whose consoles are no longer connected to anything.
1008         On some ITS machines if a dial-up line is disconnected
1009         the job tree controlled by that line will be automatically
1010         detached.  Other ITS machines do not have the hardware to
1011         to detect disconnection.
1012         When a tree is detached because its tty, whether TV, network
1013         connection, or dialup line, has disconnected, then if the
1014         tree is not logged in it will be killed immediately.
1015
1016         Whenever a tree is detached automatically for any of the
1017         reasons mentioned above, control bit 1.4 is used, so the
1018         tree will go away if it is not touched for an hour.
1019
1020         See the ATTACH and DISOWN symbolic system calls.
1021
1022 Errors:
1023
1024  14     BAD CHANNEL NUMBER
1025  31     CAN'T MODIFY JOB
1026         Cannot detach the SYS or CORE jobs, or the PDP-6.
1027  34     WRONG TYPE DEVICE
1028  35     NO SUCH JOB
1029 \f
1030 DL10MP: Hack the DL10 (pdp11 interface)
1031
1032         THIS SYSTEM CALL CAN CRASH THE SYSTEM IF MISUSED.  IT SHOULD
1033         NOT BE USED LIGHTLY.
1034
1035         arg 1   Page number
1036         val 1   AOBJN pointer to DL10 control area
1037         val 2   Pointer to 3 words for pdp11 examine/deposit commands
1038         val 3   Pointer to first free word in DL10 control area
1039
1040         A read/write, unencached, absolute page is created at the
1041         specified page number in the user's address space.  The page
1042         contains the DL10 control area, which can be used to examine,
1043         deposit, or bootload the pdp11.  A message is printed on the
1044         system console when this call is used.
1045
1046 Errors:
1047
1048 13      FILE ALREADY EXISTS
1049         The page slot specified is already in use.
1050
1051 33      MEANINGLESS ARGS
1052         The page number is invalid.
1053 \f
1054 DIRSIZ: read the total size of files in a directory.
1055
1056         arg 1   The number of a channel open on the DSK device,
1057                 or a <JOBDEV>.  The channel should be open to a file
1058                 in the directory to be hacked.
1059
1060         arg 2   (optional) quota
1061
1062         arg 3   (optional) dsk number,,allocation
1063
1064         val 1   quota,,total number of disk blocks used by files
1065                 this directory
1066
1067         val 2   dsk number,,allocation (normally 0).
1068 \f
1069 DISMIS: dismiss an interrupt                                    (ITS INTRUP)
1070
1071         arg 1   Points to the third of three words which
1072                 are the new .DF1, .DF2, and .UPC
1073                 variables for use in dismissing the interrupt
1074                 (but see the cbits for this call).
1075                 If not an immediate argument, it is assumed to
1076                 be a pdl pointer which is appropriately
1077                 popped three times to get these items.
1078                 It is then popped twice more to flush the
1079                 two interrupt words pushed by a new-style
1080                 vectored interrupt.
1081                 If the job has enabled the pdl overflow
1082                 interrupt (bit 2.8 of the .MASK user variable)
1083                 then it will receive such an interrupt if the
1084                 popping by DISMIS causes pdl underflow.
1085         arg 2   If present, overrides the new pc on the
1086                 stack specified by arg 1.
1087         arg 3   If present, overrides the new .DF1 on
1088                 the stack specified by arg 1.
1089         arg 4   If present, overrides the new .DF2 on
1090                 the stack specified by arg 1.  Thus if four
1091                 arguments are supplied, the first is
1092                 effectively ignored, except for popping.
1093         arg 5   If present, is the <losing insn addr>,,<lossage code>
1094                 for a LOSE that is done, uninterruptably,
1095                 after the interrupt has been dismissed.
1096
1097         cbits   The control-bits for this argument specify
1098                 extra words to be popped off the pdl pointer
1099                 which is the first arg, BEFORE the PC and defer
1100                 words are popped.  The cbits are ignored if the
1101                 first arg is immediate.  The intention is that
1102                 the cbits will tell DISMIS how to pop exactly
1103                 what was pushed when the interrupt happened. The
1104                 format of the cbits is the same as that of the LH of
1105                 the first word of the interrupt table (for new-style
1106                 vectored interrupts) (see ITS INTRUP), which is what
1107                 specifies what is to be pushed when an interrupt happens.
1108                 It is:
1109                 2.9=1 => throw away three words first thing.  Throws away
1110                    the debugging info that interrupts can push.
1111                 1.1-1.5 nonzero => it is number of ACs to be popped,
1112                    and 1.7-2.1 is the number of the lowest AC to be popped.
1113                 The ACs to be popped are BLT'ed out of the stack.
1114                 
1115         If four arguments are supplied and the first is
1116         immediate, then the first is totally ignored (except
1117         that the address calculation is performed).
1118         Thus this call is good for dismissing old-style
1119         interrupts as well as new-style (stack oriented)
1120         interrupts.
1121
1122         Note that if the job is using the feature that interrupts
1123         automatically push some accumulators or some debugging info,
1124         it must explicitly request (with the control bits) that the
1125         same words be popped.  DISMIS does NOT vary its function
1126         according to the job's interrupt table, for a given set of args.
1127
1128         If the interrupt handler wishes to pretend that a class 2
1129         interrupt had not been enabled, it can dismiss the interrupt
1130         and supply a fifth argument which is like the first argument
1131         to a symbolic LOSE system call.  Making the rh of that
1132         argument 1+.LZ <interrupt bit> will cause DDT to print the
1133         error message appropriate to an unhandled interrupt on that
1134         bit.  The lh. of that argument should be the address of
1135         the instruction that caused the interrupt.
1136
1137         See also the .DISMISS uuo.
1138 \f
1139 DISOWN: disown an inferior job
1140
1141         cbits   1.4     Set BUMRTL, saying that if for one hour the
1142                         job does not run and is not attached or reowned
1143                         it should be gunned down by the system.
1144                 1.3     Perform .USET <channel>,[.SUSTP,,[0]].
1145                         In this way the job is not started until
1146                         after being disowned.
1147                 1.2     Use the system resource word instead of
1148                         the disowned job resource word for scheduling.
1149                 1.1     Make this job not disowned, but rather the
1150                         top-level job of a non-disowned, non-console
1151                         controlled job tree.  This prevents the job
1152                         from receiving 1/4'th priority as ordinary
1153                         disowned jobs do.
1154         arg 1   A directly inferior <JOB>.
1155
1156         Please do not misuse the 1.1 and 1.2 control bits.  These are
1157         intended for generally useful "system daemons" only.
1158
1159         The specified job is caused to be no longer an inferior of
1160         the executing job, and is made to be the top level
1161         job of a disowned job tree.  Because of this, the disowned
1162         job will continue to exist even if its erstwhile superior
1163         does not (if, for example, the user logs out).
1164
1165         Disowning is illegal if the executing job has given control
1166         of its console to the job to be disowned (see .ATTY).
1167
1168         All channels on which the executing job has open the job being
1169         disowned will be closed in the process of disowning (see the
1170         .CLOSE uuo).  If the disowned job has opened the
1171         console, then the channels are not closed, but
1172         are marked as "disowned tty"; certain operations
1173         on such a channel will succeed, and others will hang
1174         until the job is re-owned and a console tty given
1175         to the job.  Such channels appear to be open on
1176         tty number %TINON=77 octal.
1177         A disowned job is distinguished by the fact that
1178         bit 4.9 of its .APRC user variable is set.
1179         A disowned job never succeeds in executing the RELOAD symbolic
1180         system call, even if it is the top level job in its tree.
1181         When a job tree is logged out, any micro-tapes assigned
1182         to the uname of that job tree are de-assigned (see the
1183         .ASSIGN and .DESIGN uuo's), but only if the job tree is
1184         not disowned.
1185         All disowned jobs share a resource word for purposes of
1186         scheduling, in the same way that all jobs in a single
1187         non-disowned tree share a resource word.  Thus all disowned
1188         jobs tend collectively to use no more runtime than any
1189         single non-disowned job tree.
1190         Furthermore, individual disowned jobs are given only 1/4
1191         the priority to run as a non-disowned job.  This does
1192         not apply, however, if the disowned job in question has
1193         .MASTER mode, or controls the 340 display, the E&S display,
1194         the vidisector, the arm, the LPT (line printer), or the
1195         PLT (plotter).
1196         When operating under heavy loads, the swapper prefers to
1197         swap out disowned jobs rather than non-disowned jobs.
1198
1199         The DETACH symbolic system call makes a non-disowned tree
1200         disowned.  See also the %OPDET bit of the .OPTION user
1201         variable.
1202
1203 Errors:
1204
1205  31     CAN'T MODIFY JOB
1206         The specified job must be a direct inferior.
1207 \f
1208 DSKUPD: disk update
1209
1210         arg 1   Disk channel number or <JOBDEV>
1211
1212         The creation and reference dates for the disk file
1213         open on the channel are set to the current date and time.
1214         The dump check bit is cleared (! will show in the
1215         directory).
1216         This is useful for programs which modify a file by
1217         mapping pages of the file into their page maps with write
1218         access, and which want to indicate this fact by setting
1219         the creation and reference dates.  See the CORBLK symbolic
1220         system call for mapping pages of disk files.
1221
1222         See also the FILBLK, RESRDT, RFDATE, and RQDATE
1223         symbolic system calls.
1224
1225 Errors:
1226
1227  34     WRONG TYPE DEVICE
1228         The supplied channel number must be a disk or JOB device channel.
1229 \f
1230 ECHOIN: echo characters and store them in a buffer, until a break character
1231
1232         arg 1   TTY channel number
1233         arg 2   Byte pointer to buffer
1234         arg 3   Number of characters left in buffer
1235         arg 4   Address of break table
1236         arg 5   Address of TECO buffer block (or zero)
1237
1238         The second and third arguments are counted out as characters
1239         are stored.  When the call returns due to a break character, the
1240         count will still be greater than zero.
1241
1242         ECHOIN tells the system to echo characters and insert them in
1243         the buffer specified by the second and third arguments without
1244         requiring the user program to be executed.  This is more
1245         efficient and gets visibly faster response time.  Echoing
1246         stops when either the count is exhausted or a break character
1247         is input.  When this happens, the ECHOIN returns.  If it returns
1248         because of a break character, then the break character
1249         is available for normal input.  Non-break characters following
1250         the break character are not handled.
1251
1252         Break characters are specified by the break table,
1253         a four-word block pointed to by the fourth argument.  Each of
1254         the four words says, for 32 characters, whether they break
1255         or not.  In the first word, the sign bit is for SAIL code 0,
1256         and bit 1.5 is for SAIL code 37.  The sign bit of the second
1257         word is for Space, and bit 1.5 is for ?.  And so on.
1258         Characters with Control or Meta set (including ASCII control
1259         characters on non-Meta keyboards) are always break characters.
1260
1261         To prevent timing errors, ECHOIN will return immediately if
1262         there are characters in the input buffer already.
1263
1264         For use by TECO, ECHOIN can update the block of counters which
1265         TECO uses to remember the extent of the buffer.  The fifth
1266         argument should point to this block, the "Buffer block", which
1267         is seven words long.  When a character is inserted, the first
1268         two words of the buffer block are not changed, the next four
1269         are incremented, and th next one is decremented.  Passing the
1270         buffer block to ECHOIN allows ECHOIN to insert characters
1271         directly into TECO's buffer as an indivisible operation.
1272         Note that the insertion of the characters themselves is still
1273         controlled by the byte pointer and count arguments.
1274         However, in the future this may change; when ECHOIN is made
1275         able to handle operations besides insertion, it will use the
1276         buffer block for updating the buffer (which may involve deletion)
1277         but will still insert all characters it processes down the byte
1278         pointer.  This way, TECO will have both an updated buffer and
1279         a list of the commands which the user typed.
1280 \f
1281 FILBLK: get contents of file parameter block
1282
1283         arg 1   Disk channel number or <JOBDEV>
1284         val 1   First file name.
1285         val 2   Second file name.
1286         val 3   Random information:
1287                 4.9     Dump check bit.
1288                 4.7-3.7 Word count of last block.
1289                 3.6     Has been deleted from an
1290                         unmounted pack.
1291                 3.5     Delete the file when closed.
1292                 3.4     GC mark bit.
1293                 3.3     Open for writing.
1294                 3.2     The grim file reaper should not reap this file.
1295                 3.1     This is a link, not a file.
1296                 2.9-2.5 Pack number.
1297                 2.4-1.1 Pointer to internal UFD descriptor.
1298         val 4   File creation date and time in disk format:
1299                 4.7-4.1 Year (mod 100.).
1300                 3.9-3.6 Month (January = 1).
1301                 3.5-3.1 Day of month.
1302                 2.9-1.1 Time of creation, in half-seconds
1303                         after midnight.
1304         val 5   File reference date in disk format:
1305                 4.7-4.1 Year (mod 100.).
1306                 3.9-3.6 Month (January = 1).
1307                 3.5-3.1 Day of month.
1308                 2.1-2.9 Author, as M.F.D. index.
1309                 1.1-1.9 File byte size and bit count in compressed form.
1310
1311         See also the DSKUPD, RESRDT, RFDATE, RQDATE, SFDATE,
1312         and SRDATE symbolic system calls.
1313 \f
1314 FILLEN: get file length
1315
1316         arg 1   Disk channel number or <JOBDEV>
1317         val 1   File length in bytes of the size
1318                 the channel is open in.
1319         val 2   The size of those bytes.
1320         val 3   File length in bytes of the size used to
1321                 write it (actually, the size in use the
1322                 last time it was opened for writing).
1323         val 4   The size of those bytes.
1324
1325         The length of the file open on the specified channel
1326         is returned.
1327
1328
1329 Errors:
1330
1331  34     WRONG TYPE DEVICE
1332         Currently FILLEN works only for disk files and job devices.
1333 \f
1334 FINISH: wait for output to reach the device
1335
1336         arg 1:  channel #
1337
1338         Does a FORCE (see below) then waits until all buffered
1339         output has reached the device.
1340
1341         The following devices currently support FINISH.
1342
1343         TTY:    STY:    DSK:    NET:    CHA:    TCP:
1344
1345         TCP: Does a FORCE (ensures that data is PUSH'd out) and
1346         waits until all data thus far has been ACK'd, i.e. acknowledged
1347         by the foreign host.
1348
1349         Chaosnet: (channels opened with CHAOSO)
1350         On an output channel, does FORCE and then waits until
1351         there are no queued output buffers.  I.e., waits for
1352         all output to be received and acknowledged by the foreign
1353         host.  This in fact waits for acknowledge, not just receipt.
1354
1355 Errors:
1356 *       Any errors which the FORCE call might encounter.
1357 \f
1358 FLAP:   flap a micro-tape
1359
1360         arg 1   Micro-tape number (typically 1-4).
1361
1362         The directory for the micro-tape is written back onto
1363         the tape if it is currently in core; the tape is then
1364         physically dismounted by running the tape back onto
1365         the original reel (thereby making the tape go flap, flap,
1366         flap ...).  Micro-tapes should not be manually dismounted,
1367         for this will cause the directories to get out of phase,
1368         messing up the dismounted tape and also the next one to
1369         use the drive.  The FLAP will fail if any files are still
1370         open on the specified drive, or if any one else has the
1371         drive assigned to him.
1372         See also the .UDISMT uuo.
1373 \f
1374 FLUSH:  wait for output to reach the device
1375
1376         arg 1:  channel #
1377
1378         This call has been renamed to FINISH (in ITS 1052).
1379         The old name will be kept around for a while, but new
1380         programs should not use it.
1381 \f
1382 FORCE:  empty out device's output buffers
1383
1384         arg 1 - channel #
1385
1386         If any output is buffered for the device, it is now sent
1387         to the device.  Note that this is not needed for the TTY
1388         device since output is always sent as soon as possible.
1389
1390         It is not necessary to do a FORCE before doing CLOSE.
1391
1392         The following devices currently support FORCE:
1393
1394         NET:    Causes output to be sent as soon as possible;
1395                 otherwise it would only be sent when the buffer
1396                 was full or when 2 seconds have elapsed since
1397                 output was first put in the buffer.
1398
1399         TCP:    Same as NET, except that the PUSH flag is set
1400                 in outgoing segments.  If there is no buffered data,
1401                 nothing is sent.  (Note that ITS TCP always sets PUSH
1402                 in all outgoing segments whether FORCEd or not.
1403                 Otherwise, a FORCE with an empty buffer would require ITS
1404                 to re-send old data with PUSH set in order to nudge the
1405                 remote site into action.)
1406
1407         DSK:    Causes the current output buffer and the directory
1408                 to be written to disk.
1409
1410         Chaosnet: (channels opened with CHAOSO)
1411                 If there is a partially-filled output packet (created by IOT
1412                 or SIOT), it is transmitted.
1413
1414         The following devices ignore FORCE (it always skip returns)
1415         because they don't need it:
1416
1417         TTY:    STY:    LPT:    PLT:    PTP:    COD:
1418
1419 Errors:
1420  2      WRONG DIRECTION
1421         TCP: Channel is not an output channel.
1422  7      DEVICE NOT READY
1423         TCP: Connection not open for writing.
1424 34      WRONG TYPE DEVICE
1425         The device is not an output device, or does not have
1426         the kind of buffered up output which needs this call.
1427 \f
1428 IOPOP:  pop input/output channel
1429
1430         arg 1   Channel number
1431
1432         The top entry on the job's IO pdl is popped into the
1433         specified channel.  Entries on the IO pdl are made
1434         only by pushing channels with IOPUSH.  If a channel
1435         is pushed with IOPUSH and then popped into with IOPOP,
1436         it is in exactly the same state as it would have been
1437         if left untouched; however, the channel is available
1438         for other use in the meantime.
1439 \f
1440 IOPUSH: push input/output channel
1441
1442         arg 1   Channel number
1443
1444         The contents of the specified channel are pushed onto
1445         the job's IO pdl, and the channel is put into a
1446         "closed" state.  If the channel had been open, the
1447         open file is not closed, but is instead now open on
1448         the IO pdl slot instead of on the channel.  It is
1449         not accessible to the job for IOT'ing, etc., while
1450         there, but it can be popped back into a channel with
1451         IOPOP and then will be available for IO.
1452
1453 \f
1454 IOT:    input/output transfer
1455
1456         cbits   Per-IOT mode bits.  Device dependent.
1457         arg 1   Channel number.  LH XOR'd with control bits.
1458         arg 2   Location for input/output transfer.
1459                 May not be immediate.
1460                 For unit mode, this is the word to
1461                 output from or read into.
1462                 For block mode this is an AOBJN
1463                 pointer to a buffer.
1464         arg 3   (Optional) device-independent special mode bits.
1465                 These are not currently used.
1466
1467         For ease of use, in unit input mode arg 2 and arg 3
1468         may be omitted and val 1 will then be the word read.
1469
1470 For TTY and Tnn devices (terminals in general),
1471         the following control bits are effective for IOT.
1472         They are XOR'd into the left half of the I/O channel
1473         word both before and after the IOT (see the .IOC user
1474         variable).  Thus one can modify the tty's
1475         characteristics temporarily for just one IOT.
1476                                                                 (ITS TTY)
1477         Control bits on input:
1478         2.6     %TIECH  Read even if char needs pi echoing
1479         2.5     %TIPEK  Don't remove char from buffer (peek)
1480         2.3     %TIACT  Don't wait for activation char
1481         2.2     %TIINT  Read even if char is an interrupt
1482                         char and hasn't interrupted yet.
1483         2.1     %TINWT  If no input available, don't wait, but return -1.
1484         1.9     %TIFUL  Use full character set (for Imlacs and TV's).
1485
1486         Control bits on output:
1487         2.6     %TJECH  Echo mode output.
1488         2.5     %TJCTN  Don't do line continuation.
1489         2.3     %TJDIS  Recognize ^P cursor codes.
1490         2.2     %TJSIO  Super-image output.  No padding
1491                         or cursor control is performed.
1492         2.1     %TJMOR  Do not do **MORE** processing.
1493         1.9     %TJPP2  Output in the echo area if it exists.
1494         1.7     %TJHDE  Account for cursor motion due to characters
1495                         echoed on a half-duplex tty.
1496 For the Chaosnet (channel opened with CHAOSO):
1497         1.4     ??      Don't hang.
1498
1499         This can be used to do unit-mode 8-bit-byte transfers.
1500         Control bit 1.4 means don't-hang, and applies to both input
1501         and output.  Only data packets with opcode 200 will be
1502         transferred.  Anything else on input causes the transfer
1503         to stop, like an end-of-file.  Use PKTIOT to find out what
1504         the story is.  (The correct way is to verify that there are
1505         some packets in the input buffer, then do a (S)IOT, and if it
1506         transfers 0 bytes then the first packet in the input buffer
1507         must not be a data packet, so PKTIOT it in.)
1508
1509         There can be input available to (S)IOT even when the state is
1510         not %CSOPN (e.g. if the input buffer contains data and
1511         a CLS packet.)  In this case, you should first (S)IOT (if you
1512         care to pick up the data) then PKTIOT.
1513
1514
1515 Errors:
1516
1517  14     BAD CHANNEL NUMBER
1518  33     MEANINGLESS ARGS
1519         The second argument was immediate.
1520 \f
1521 IPKIOT: Internet packet (datagram) I/O
1522
1523         This call is similar to PKTIOT and works for channels
1524         opened on the IPQ device.  It should NOT BE USED without
1525         a good understanding of Internet Protocol datagram formats.
1526         This call is still subject to change and thus is not
1527         documented further.  Ask KLH if you think you need to use it.
1528 \f
1529 ITYIC:  read tty interrupt character
1530
1531         arg 1   <TTY>
1532         val 1   a character
1533
1534         This call fails to skip if there is no input
1535         interrupt character to be read from the tty.
1536         Otherwise, it returns the next un-ITYIC'ed
1537         input interrupt character.
1538         ITYIC'ing a character does not remove it from
1539         the input buffer - it is still there to be IOT'ed
1540         in its turn, along with the non-interrupt characters.
1541         ITYIC makes it possible for a program to scan input
1542         interrupt characters as they interrupt, without
1543         interfering with the IOT'ing that will take place
1544         later.
1545 \f
1546 JOBCAL: get info on how job device was called
1547
1548         arg 1   BOJ channel number or <JOBDEV>
1549         arg 2   Optional: AOBJN pointer for job call data.
1550         arg 3   Optional: sixbit device name for PEEK and who-lines.
1551         val 1   "opcode" for requested operation.
1552
1553         See ITS JOB for information on job devices.
1554
1555         This call is to be executed by a JOB device when it
1556         receives an interrupt on its BOJ channel.  It returns
1557         data describing the operation desired by the calling job.
1558         Note that the second argument is an AOBJN pointer
1559         to an area in which the call will place data, not get it!
1560
1561         The third argument, if present, is a device name to be used
1562         by PEEK and who-lines for printing things like ARCBO.
1563         (This name is initialized to the device name returned as word
1564         4 by OPEN - see below.  The unknown-device handler, if involved
1565         in the process (see the OPEN symbolic system call), resets
1566         this to the second file name of the JOBDEV file it actually
1567         succeeded in loading (this name may have had digits stripped off).)
1568
1569         The "opcode" describes the operation to be performed:
1570                 4.9-4.7 Open mode, if 2.9-1.1 contains 0.
1571                 4.6     Close 
1572                 4.5     Close (both bits always the same)
1573                 4.1     SIOT rather than IOT
1574                 3.8     pclsred call restarting
1575                 2.9-1.1 0       .OPEN
1576                         1       .IOT
1577                         2       MLINK (make a link)
1578                         3       .RESET
1579                         4       .RCHST
1580                         5       .ACCESS
1581                         6       .FDELE (delete or rename)
1582                         7       .FDELE (rename while open)
1583                         8       .CALL
1584
1585         The second argument should point to a block of 12
1586         words (0-11) in which the following data are deposited:
1587
1588         OPEN
1589                 wd 1    First file name.
1590                 wd 2    Second file name.
1591                 wd 3    Directory name.
1592                 wd 4    Device name.
1593                 wd 5    Full 18.-bit open mode in right half.
1594                 wd 7    BP or AOBJN ptr specifying filename, if
1595                         the SOPEN call was used to do the open.
1596                         Zero otherwise.
1597
1598         IOT
1599                 wd 0    For block IOTs, the loser's IOT
1600                         pointer.  The left half contains the
1601                         negative of the desired number of words.
1602                         For SIOTs, the byte count.  1 for unit IOTs.
1603
1604         ACCESS
1605                 wd 0    The address within the file to access.
1606                         The beginning of the file is 0.
1607
1608         MLINK
1609                 wd 0    Linked-to FN1.
1610                 wd 1    FN1 of the link.
1611                 wd 2    FN2 of the link.
1612                 wd 3    Directory name of the link.
1613                 wd 4    Device name of the link.
1614                 wd 5    Linked-to FN2.
1615                 wd 6    Linked-to directory.
1616                 wd 7    BP or AOBJN ptr specifying name of link,
1617                         or 0 if the name was specified as SIXBIT.
1618                 wd 10   BP or AOBJN ptr specifying name to link to,
1619                         or 0 if the name was specified as SIXBIT.
1620           (note links from one device to another don't exist).
1621
1622         FDELE (rename or delete)
1623                 wd 0    Zero implies delete.  Otherwise, the
1624                         new first file name.
1625                 wd 1    Old first file name.
1626                 wd 2    Old second file name.
1627                 wd 3    Name of directory.
1628                 wd 4    Name of device.
1629                 wd 5    Zero implies delete.  Otherwise, the
1630                         new second file name.
1631                 wd 7    BP or AOBJN ptr specifying file to act on,
1632                         or 0 if the name was specified as SIXBIT.
1633                 wd 10   BP or AOBJN ptr specifying name to rename to,
1634                         or 0 if the name was specified as SIXBIT.
1635
1636         FDELE (rename while open)
1637                 wd 0    Zero implies delete.  Otherwise, the
1638                         new first file name.
1639                 wd 5    Zero implies delete.  Otherwise, the
1640                         new second file name.
1641                 wd 10   BP or AOBJN ptr specifying name to rename to,
1642                         or 0 if the name was specified as SIXBIT.
1643
1644         CALL
1645                 wd 0    Name of operation in sixbit.
1646                 wd 1    Control bits for the call.
1647                 wd 2    Number of following words.
1648                 wds 3-n Input arguments to call.  The first
1649                         will almost always be a channel number.
1650                         Values may be returned via the
1651                         JOBRET symbolic system call.
1652
1653 Errors:
1654
1655  34     WRONG TYPE DEVICE
1656         The first argument must be a BOJ channel number or
1657         a JOB device channel number.
1658 \f
1659 JOBGET: get job device information
1660
1661         This symbolic system call is ARCHAIC and OBSOLETE.
1662         It is documented here for historical purposes only.
1663         Its use in new programs is to be avoided.
1664         Its function has been superseded by the JOBCAL
1665         symbolic system call.
1666
1667         arg 1   BOJ channel number or <JOBDEV>
1668
1669         The individual returned values are identical to
1670         the words returned by JOBCAL in the area specified
1671         by JOBCAL's second argument.
1672 \f
1673 JOBINT: cause caller of JOB device to get an interrupt
1674
1675         arg 1   BOJ channel number or <JOBDEV>
1676
1677         See ITS JOB for information on job devices.
1678
1679         This is used by JOB devices to cause the calling job
1680         to receive a word 2 interrupt for the channel it has
1681         the JOB device open on.  See also the SETIOC
1682         symbolic system call.
1683
1684 Errors:
1685
1686  34     WRONG TYPE DEVICE
1687         The first argument must be a BOJ channel number
1688         or a JOB device channel number.
1689  41     OTHER END OF PIPELINE GONE OR NOT OPEN
1690 \f
1691 JOBIOC: set input/output channel error
1692
1693         arg 1   BOJ channel number or <JOBDEV>
1694         arg 2   IOC error code.
1695
1696         This is used by JOB devices to cause the calling job
1697         to receive a word 1 IOC interrupt.  This interrupt
1698         will be given when the calling job next attempts
1699         an IOT operation.  The .BCHN variable for that job
1700         will be set to the channel it has the JOB device 
1701         open on, and bits 4.1-4.5 of the corresponding
1702         .IOS word are set to the specified IOC error code.
1703         See also the JOBINT symbolic system call.
1704
1705         Valid IOC error codes are as follows:
1706           1     ILLEGAL HARDWARE OPERATION ATTEMPTED
1707           2     ATTEMPTED RANDOM ACCESS TO ADDRESS BEYOND END OF FILE
1708           3     NON-RECOVERABLE DATA ERROR
1709           4     NON-EXISTENT SUB-DEVICE
1710           5     OVER IOPOP
1711           6     OVER IOPUSH
1712           7     USR OP CHNL DOES NOT HAVE USR OPEN
1713          10     CHNL NOT OPEN
1714          11     DEVICE FULL (can also mean a directory is full)
1715          12     CHNL IN ILLEGAL MODE ON IOT
1716          13     ILLEGAL CHR AFTER CNTRL P ON TTY DISPLAY
1717          14     DIRECTORY FULL
1718          15     DIRECTORY'S ALLOCATION EXHAUSTED
1719
1720 Errors:
1721
1722  33     MEANINGLESS ARGS
1723         Second argument is not a valid IOC error code.
1724  34     WRONG TYPE DEVICE
1725         First argument is not a BOJ channel number.
1726  41     OTHER END OF PIPELINE GONE OR NOT OPEN
1727 \f
1728 JOBRET: return values to loser and let him continue
1729
1730         arg 1   BOJ channel number or <JOBDEV>
1731         arg 2   LH contains error code, or 0 if none.
1732                 RH contains amount for loser to skip.
1733         arg 3   Optional AOBJN pointer to a block
1734                 of values to be returned to the loser.
1735
1736         See ITS JOB for information on job devices.
1737
1738         This call is used by JOB devices to cause the
1739         calling job to continue after an input/output request.
1740         The second argument specifies an error code in its LH;
1741         if non-zero it is placed in bits 3.6-3.1 of the .IOS
1742         word for the JOB device (see the STATUS symbolic
1743         system call).  The RH contains the amount by which
1744         the loser should skip upon continuing if he used a .CALL;
1745         this amount is usually 0 or 1.  The third argument is
1746         an AOBJN pointer to a block of values which are
1747         passed back to the .CALL or to the .RCHST.
1748
1749 Errors:
1750
1751  34     WRONG TYPE DEVICE
1752         First argument must be a BOJ channel number
1753         or a JOB device channel number.
1754  36     VALID CLEAR OR STORED SET
1755 \f
1756 JOBREU: Lets a JOB device handler offer itself for re-use
1757
1758         arg 1   Device name that the handler can handle
1759         arg 2   FN1 of file the handler was loaded from
1760         arg 3   FN2 of file the handler was loaded from
1761         arg 4   SNAME of file the handler was loaded from
1762                 (Note:  the only device it could have been
1763                  loaded from is DSK).
1764         arg 5   Amount of time to wait (for someone to try
1765                 to re-use us) before giving up and taking the
1766                 failure return, in 30'ths of a second.
1767                 Alternatively, minus the time to wait until
1768                 (in 30'ths since the system was started up).
1769                 If the argument is positive (a duration) it
1770                 is converted to a negative one (time to stop)
1771                 and written back.
1772
1773         Some job device handlers take a considerable amount of
1774         work to initialize themselves - for example, the ML device
1775         must set up network connections to another machine.
1776         Improved performance results if the same handler job
1777         can be used for several OPENs, instead of having to
1778         load a new job and open a new set of network connections
1779         for each one.  The JOBREU call makes this possible.
1780         The time to use it is when the handler has completed all
1781         of the business for one operation - it has received a
1782         "CLOSE" from its creator, has tidied up its data bases,
1783         and would otherwise have nothing to do except log out.
1784         Instead, it can do a JOBREU.  During the time period
1785         specified in the JOBREU, if any job tries to do an OPEN
1786         on a job device which this handler could be used for,
1787         this handler job will in fact be used.  In this case,
1788         the JOBREU will skip return.  The handler should then
1789         act as if it had just been loaded, and do the "initial
1790         JOBGET".  If nobody tries to reuse the handler in the
1791         specified time period, the JOBREU will return without
1792         skipping, and the handler should log out.
1793
1794         Note that one should not do a JOBREU immediately upon
1795         receiving a close when the JOBRET of the initial OPEN
1796         has failed, because the creator has pclsred and is
1797         likely to be coming back.  In order to make it use the
1798         same job device when it comes back, JOBREU should not
1799         be done; instead, a PCLSRed JOB device open automatically
1800         finds the right job and sends another request to it.
1801         You should time out and if this second request does not
1802         come in, then give up and do a CLOSE and a JOBREU.
1803
1804         There are two kinds of OPENs that can invoke the JOB device:
1805          1) An open of JOB:<filenames> explicitly.  It can reuse a
1806             job device handler if <filenames> match the FN1, FN2,
1807             and SNAME specified in the JOBREU.
1808          2) An open of a device name (such as ARC) that is not
1809             built into the system.  Such an open can reuse a job
1810             device handler if the device name matches the one
1811             specified in the JOBREU.
1812
1813
1814 Errors:
1815
1816  10     DEVICE NOT AVAILABLE
1817         This job isn't a JOB-device handler.
1818  13     FILE ALREADY EXISTS
1819         This job device handler is already (still) in use
1820         by a creator.
1821  41     OTHER END OF PIPELINE GONE OR NOT OPEN
1822         Nobody tried to reuse this job, and the time period ran out.
1823 \f
1824 JOBSTS: set JOB device status
1825
1826         arg 1   BOJ channel number or <JOBDEV>
1827         arg 2   New JOB device status - stored in the RH of
1828                 the job channel's .IOS word, where .STATUS
1829                 on the job channel will find it.
1830                 This may be arbitrary, of course, but the
1831                 standard bits are as follows:
1832                 2.9-2.3 Device dependent.
1833                 2.2     Buffering capacity empty.
1834                 2.1     Buffering capacity full.
1835                 1.9-1.7 Mode in which device was opened.
1836                         1.9     0 = ascii, 1 = image.
1837                         1.8     0 = unit, 1 = block.
1838                         1.7     0 = input, 1 = output.
1839                 1.6-1.1 ITS internal physical device code.
1840                         For a job device this should be 22,
1841                         unless you really know what you are
1842                         doing.
1843                 If omitted, 000022 is used.
1844         arg 3   Sets the "device name" of this channel.
1845                 The device name is used by the RFNAME
1846                 and RCHST system calls, and by PEEK
1847                 and who-lines, to say what device a job
1848                 is transferring to or waiting for in the
1849                 job's status.  The argument is optional.
1850         arg 4   Sets the "file name 1". Optional.
1851         arg 5   Sets the "file name 2". Optional.
1852         arg 6   Sets the "system name". Optional.
1853         arg 7   Sets the "open mode" that will be returned
1854                 by the RFNAME system call.  Optional.
1855         arg 8   Optional byte pointer to ASCIZ string in device handler's
1856                 address space containing full filenames.  The byte pointer
1857                 my not be indexed or indirect.  Note that ITS might decide
1858                 to read a string from this byte pointer at any time, so the
1859                 string must continue to exist even after the JOBSTS call
1860                 has returned.
1861
1862         When the channel is first opened the device, file
1863         name 1, file name 2, system name, and open mode
1864         are set to the ones by which the channel was opened.
1865         JOB device programs may change these if they wish,
1866         but are not required to.        
1867
1868         See the STATUS symbolic system call, the .STATUS uuo,
1869         and the RFNAME system call.
1870
1871         See ITS JOB for information on job devices.
1872 \f
1873 KLPERF: Use KL10 performance analysis counter
1874
1875         arg 1   <JOB> whose performance is to be measured
1876                 -3 (%JSNUL) => the null job
1877                 -4 (%JSALL) => all jobs
1878                 0,,-3 and 0,,-4 are also acceptable.
1879         arg 2   Performance Analysis Enables word
1880                 0 => turn off the performance counter
1881                 and make it available for other users.
1882                 See DEC drawing M8538-0-MTR4 for the bits in this
1883                 argument.
1884         val 1   Previous <JOB> setting; -3, -4, or a job number
1885         val 2   Previous Performance Analysis Enables word
1886         val 3   High-order word of the time base
1887         val 4   Low-order word of the time base
1888         val 5   High-order word of the performance counter
1889         val 6   Low-order word of the performance counter
1890
1891         If no arguments are supplied, the state of the counter
1892         is not changed and the six values are returned.
1893
1894         If arguments are supplied, the performance analysis counter
1895         is siezed so no other users can interfere and performance
1896         measurement begins.  When the specified job is running
1897         and the conditions specified in the Enables word are met,
1898         the performance counter counts.  A bit in the Enables
1899         word controls whether it counts the duration, in microseconds,
1900         that the conditions were satisfied, or the number of times
1901         that the conditions became satisfied.  While the specified
1902         job is running, the time base counts microseconds.  If -4
1903         (all jobs) was specified, this is the elapsed real time.
1904         Issuing the KLPERF call again allows the results to be
1905         determined by subtracting the values obtained the first time
1906         from the values obtained the second time.
1907
1908         The two counters are double-precision numbers.  The high-order
1909         35 bits are in bits 1.1-4.8 of the high-order word, and
1910         the low-order 23 bits are in bits 2.4-4.8 of the low-order
1911         word.
1912
1913 Errors:
1914
1915  10     DEVICE NOT AVAILABLE
1916         Someone else is using the performance analysis counter.
1917  14     BAD CHANNEL NUMBER
1918         Argument 1 is invalid.
1919  35     NO SUCH JOB
1920         Argument 1 specified a non-existent job.
1921 \f
1922 LISTEN: listen for any typed-ahead input                        (ITS TTY)
1923
1924         arg 1   <TTY> (but not a STY channel) or <JOBDEV>
1925         val 1   Number of typed-ahead characters pending.
1926
1927         Waits for output buffer to empty before listening.
1928         To check for input without waiting for output use
1929         .STATUS.  The uuo .LISTEN is the same as LISTEN,
1930         but applies only to the job's console, and furthermore
1931         returns zero if the job doesn't possess the tty.
1932
1933 Errors:
1934
1935  14     BAD CHANNEL NUMBER
1936 \f
1937 LNKEDP: find out whether open file was reached via a link
1938
1939         arg 1   Channel number of open disk file
1940         val 1   Nonzero if file was reached via a link.
1941
1942         The file open was reached through a link if the names
1943         actually specified in the OPEN were the names of a link
1944         which pointed at this file.  It is not a question of
1945         what file is open, but of what names were specified to
1946         open the file.
1947
1948 Errors:
1949
1950 14      BAD CHANNEL NUMBER
1951         Arg 1 is not between 0 and 17.
1952 34      WRONG TYPE DEVICE
1953         Arg 1 does not specify a disk channel.
1954 \f
1955 LOAD:   load file (a program) into a job
1956
1957         arg 1   <JOB>
1958         arg 2   Disk channel number (freshly opened for reading).
1959         arg 3   Optional argument which causes part of the file
1960                 to be ignored:  either <start>,,<end>, to load
1961                 only between addresses <start> and <end> (inclusive),
1962                 or zero meaning load only pure pages.
1963                 The default is 0,,-1 normally, 20,,-1 when loading
1964                 oneself, and 20,,37777 when loading the PDP6.
1965                 When loading a PDUMP format file, <start> and <end>
1966                 are rounded outward to page boundaries.
1967
1968         The file open on the input channel is loaded into
1969         the specified job.  The file may be in one of two formats:
1970         PDUMP format, or SBLK format.  The former is produced by
1971         the PDUMP symbolic system call, under which its format
1972         is documented.  The latter is described below.
1973         The two formats are distinguished by the
1974         fact that a PDUMP format file begins with a zero word,
1975         but an SBLK format file begins with a non-zero word.
1976
1977         SBLK format:
1978         First off, any words in the file are ignored until a word
1979         254000,,1 (JRST 1) is found.  This should be followed
1980         by zero or more blocks of the following form:
1981         wd 0    -<n>,,<loc>
1982         wds 1-n data words
1983         wd n+1  checksum
1984         That is, the first word is an AOBJN pointer describing where
1985         to load <n> consecutive words of data into the job; this is
1986         effectively used as a block .IOT pointer to load the words.
1987         Following the data is a checksum, which is ignored.
1988         (Historically, when microtapes were used, the checksum was
1989         necessary for error checking.)
1990         Following the last block must be a non-negative word
1991         to denote the fact that there are no more blocks.
1992         This word and all succeeding words in the file are ignored.
1993         (DDT assumes that this word contains the starting
1994         address of the program, and that following words contain
1995         the symbol table for the program.)  The disk channel
1996         is left open, with the access pointer pointing to the
1997         positive word which followed the last block.
1998
1999         The standard form of symbol table is:
2000         -<2*n>,,0
2001         squoze code,symbol  --  these 2 words are
2002         value of symbol     --  repeated n times
2003
2004         The word after the symbol table is another copy of the starting address.
2005
2006 Errors:
2007
2008 7       DEVICE NOT READY
2009         A disk read error occurred.
2010 31      CAN'T MODIFY JOB
2011         The calling job may not write into the job being loaded.
2012 32      CAN'T GET THAT ACCESS TO PAGE
2013         You tried to create an absolute page pointing to memory
2014         that the system doesn't have.
2015 34      WRONG TYPE DEVICE
2016         Arg 2 does not specify a disk read channel, or
2017         you tried to load a PDUMP file into the PDP-6.
2018 37      NO CORE AVAILABLE
2019         The MMP was full so a needed page could not be created.
2020 46      UNRECOGNIZABLE FILE
2021         The file open on the specified channel is not in
2022         valid SBLK format, nor in valid PDUMP format.
2023 \f
2024 LOGIN:  log in a job tree
2025
2026         arg 1   Sixbit name to log in under.
2027                 " " (0) and "___xxx" (-1 in left half) are illegal.
2028         arg 2   Sixbit name of "terminal."  This is not required 
2029                 for hard-wired terminals.  When this field specifies
2030                 a network host, the standard form is HSTnnn, where
2031                 nnn is the octal host number, however often the English
2032                 name of the host, abbreviated to six letters, is used.
2033         arg 3   Sixbit XUNAME.  This is normally the same as arg 1
2034                 except that if arg 1 is changed to make it unique,
2035                 this should not be changed.  The XUNAME is what is
2036                 used for accounting purposes.
2037
2038         The uname for the job tree is changed from "___nnn"
2039         (where "nnn" is the top-level job's user index in
2040         sixbit octal characters), which is the initial uname of
2041         a non-logged-in job tree, to the specified sixbit name.
2042         If the job tree already has a uname other than "___nnn",
2043         the LOGIN fails.  Only top-level jobs with no direct
2044         inferiors may LOGIN.
2045
2046 Errors:
2047
2048  11     ILLEGAL FILE NAME
2049         Cannot log in as "___xxx" or " ".
2050  12     MODE NOT AVAILABLE
2051         Jobs with direct inferiors may not log in.
2052  13     FILE ALREADY EXISTS
2053         Someone is already logged in under the specified name.
2054  31     CAN'T MODIFY JOB
2055         Already logged in.
2056  40     NOT TOP LEVEL
2057         Only top-level jobs may log in.
2058 \f
2059 LOGOUT: log out a job tree
2060
2061         No arguments or values (note, however, that at least
2062         one must be present in order to contain the 4.9 bit
2063         terminating the argument list).  If the executing
2064         job is the top level job in its job tree, then the
2065         entire job tree is expunged from the system.
2066         Does not skip if not a top level job.  This is not
2067         considered an error, however; no error code is returned.
2068         See also the .LOGOUT uuo.
2069 \f
2070 LOSE:   report lossage
2071
2072         arg 1   left half - address of losing instruction
2073                 right half - lossage code (defined by DDT.)
2074         arg 2   new PC.  If omitted, the address of the .CALL
2075                 minus one is used.
2076         control bits:
2077         1.1     default arg 2 to the address of the .CALL plus one.
2078         1.2     do SETZM @.40ADDR, i.e. clear the location
2079                 in the job where a UUO returned from the
2080                 system would be stored.
2081         1.3     Really take the left half of arg 1 as the address
2082                 of the losing instruction.  If this control bit
2083                 is not specified, the new PC is used instead.
2084
2085         The job's Program Counter is set to the new PC,
2086         the job's .VAL user variable is set to the address
2087         of the losing instruction,,the lossage code, and the
2088         job is given a %PILOS interrupt.  If the job does not
2089         enable this interrupt, and its superior is DDT, a
2090         helpful error message will be printed.
2091
2092         The LOSE symbolic system call is a more general version
2093         of the .LOSE UUO.  .LOSE is simpler, and usually good
2094         enough.  Symbolic LOSE is for situations where sophisticated
2095         error reporting is needed. Symbolic LOSE allows the new PC
2096         value to be specified explicitly, and therefore is suitable
2097         for use inside an error-handling subroutine.  In addition,
2098         the address of the "culpable" instruction can be specified
2099         independantly from the address to restart at.  Thus, the
2100         program can provide more complicated error recovery
2101         than simply restarting at the losing instruction.
2102
2103         The lossage codes are defined by DDT's interpretation of them.
2104         The defined values are:
2105
2106         %LSSYS==1000    The last error code returned by a failing
2107                 system call describes the problem.
2108
2109         %LSFIL==1400    The last error code returned by a failing
2110                 system call, together with the name of the file
2111                 it was operating on, describe the problem.
2112                 The "culpable instruction" address should point
2113                 at the failing system call.
2114                 DDT will decode it to determine the filenames
2115                 (if it is an OPEN) or the channel number and then
2116                 the filenames via an RFNAME.
2117
2118         %LSSYS+errcode  Means that the system call error code
2119                 <errcode> describes the problem.
2120
2121         %LSFIL+errcode  Means that the error code <errcode>
2122                 together with the filenames being used
2123                 describe the problem.
2124
2125         0       Signifies some other nondescript error condition.
2126
2127         1+.LZ <interrupt bit>
2128                 Means that the error should be handled as if it
2129                 were a fatal interrupt on the specified interrupt
2130                 bit.  For example, 1+.LZ %PIMPV will make DDT tell the
2131                 user that the job received a fatal MPV interrupt.  Why
2132                 might a program wish to do this?  It might have
2133                 enabled its own handling of MPV, and then received an
2134                 MPV interrupt at a time when one was not expected and
2135                 was not recoverable.  At such a time the ideal thing
2136                 to do is to report the MPV back to DDT, so that DDT
2137                 will handle it - to "pretend" that MPV wasn't enabled
2138                 at all.  To make the pretense complete, the program's
2139                 own MPV interrupt handler should dismiss the
2140                 interrupt, and leave the PC pointing at the guilty
2141                 instruction, since that would be the state of things
2142                 if the program had not handled the interrupt.  That
2143                 can be done with a special feature of the DISMIS
2144                 symbolic system call, which can do a .LOSE after
2145                 dismissing the interrupt and restoring the PC.
2146
2147         This call never gets an error, and never returns.
2148 \f
2149 MLINK:  make link
2150
2151   Either
2152         arg 1   Byte pointer to ASCIZ string specifying name for link,
2153                 or AOBJN pointer to block of byte pointers,
2154         arg 2   Byte pointer to ASCIZ string specifying name to link to,
2155                 or AOBJN pointer to block of byte pointers,
2156
2157   Or
2158         arg 1   Left-justified "from" device.
2159         arg 2   "from" file name 1.
2160         arg 3   "from" file name 2.
2161         arg 4   "from" sname.
2162         arg 5   "to" file name 1.
2163         arg 6   "to" file name 2.
2164         arg 7   "to" sname.
2165
2166         A link is created on the specified device.
2167         The only standard device which accepts links
2168         is DSK; of course, various job devices (such as
2169         the AI, ML, DM, and MC devices) also implement it.
2170         Links cause an indirection when opened
2171         for reading;  writing or deleting a link affects
2172         the link itself.
2173         The "from" file names are subject to file name
2174         translation.  See the TRANAD and TRANDL symbolic
2175         system calls.
2176
2177         See the SOPEN symbolic system call for a description of
2178         how the byte or AOBJN pointer arguments should be formatted
2179         and how the strings are parsed into filenames.
2180 \f
2181 NETAC:  accept network connection               OBSOLETE        (ITS NCP)
2182
2183         This system call is obsolete, and has been flushed.
2184         It is documented here for historical purposes only.
2185
2186         arg 1 - channel # of an Arpanet NCP channel
2187
2188         If the channel is in the RFC-received state, the
2189         connection is accepted.  Use CLOSE to refuse a
2190         request for connection.
2191
2192         See also the .NETAC UUO.
2193
2194         This call only works for NCP and is obsolete.  It isn't needed
2195         for TCP since incoming requests that satisfy a LISTEN will
2196         automatically be hooked up and the connection opened.
2197
2198 Errors:
2199
2200 34      WRONG TYPE DEVICE
2201         The specified channel is not an Arpanet NCP channel
2202 41      OTHER END OF PIPELINE GONE OR NOT OPEN
2203         The socket is not in the %NSRFC (request for
2204         connection received) state.
2205 \f
2206 NETBLK: network block                                           (ITS NCP)
2207
2208         arg 1   Channel number - should be a network channel.
2209                 NCP, TCP, and CHAOS are allowed.
2210         arg 2   Connection state code.
2211                 NCP: Socket state as returned in the right
2212                 half of word 4 by the .RCHST uuo:
2213                 0       %NSCLS  CLS received.
2214                 1       %NSLSN  Listening for RFC.
2215                 2       %NSRFC  RFC received while listening.
2216                 3       %NSRCL  CLS received while in RFC received state.
2217                 4       %NSRFS  RFC sent.
2218                 5       %NSOPN  Connection open.
2219                 6       %NSRFN  RFNM wait on write link.
2220                 7       %NSCLW  CLS sent.  Waiting for matching CLS.
2221                 10      %NSCLI  CLS received, but input still available.
2222                 11      %NSINP  Input available.
2223                 CHAOS:
2224                 TCP: basically the same as NCP.  See WHYINT for state list.
2225         arg 3   Optional: address of a word containing an argument
2226                 as for the .SLEEP uuo.  This word must be writable,
2227                 as it will be replaced by an appropriate negative
2228                 number as for .SLEEP.
2229                 If not supplied, positive infinity (377777,,777777)
2230                 is assumed by default for the time to sleep.
2231         val 1   New connection state.
2232         val 2   Time left, in thirtieths of a second.
2233                 (Meaningful only if arg 3 supplied.)
2234
2235         The executing job hangs until one of two conditions
2236         becomes true: either the network conection associated
2237         with the specified channel enters a state different
2238         from the specified state, or the amount of time
2239         specified by arg 3 has passed.
2240
2241         Example:  suppose that a NCP socket is in state 1
2242         (listening for RFC).  This call will return when
2243         the socket is no longer in that state, or after 5
2244         seconds, whichever comes first:
2245
2246                 MOVEI AC,5*30.          ;five seconds
2247                 .CALL [ SETZ
2248                         SIXBIT \NETBLK\         ;network block
2249                           1000,,CHNUM           ;channel number
2250                           1000,,%NSLSN          ;old state
2251                               ,,AC              ;time to sleep
2252                           2000,,NSTATE          ;new state
2253                         402000,,TLEFT   ]       ;time left
2254
2255 Errors:
2256
2257 34      WRONG TYPE DEVICE
2258         The specified channel is not a network (NCP, TCP, CHAOS) channel.
2259 \f
2260 NETHST: net host status                                         (ITS NCP)
2261
2262         arg 1   Host number (-1 for self).
2263         arg 2   Reason for going down (optional, valid
2264                 only if arg 1 is -1).
2265                 5       Going down for scheduled P.M.
2266                 6       Going down for scheduled hardware work.
2267                 7       Going down for scheduled software work.
2268                 10      Going down for emergency restart.
2269                 11      Going down because of power outage.
2270                 12      Stopping at software breakpoint.
2271                 13      Going down because of hardware failure.
2272                 14      Going down because not scheduled to be up.
2273         val 2   Host number (useful if arg 1 is -1).
2274                 Note THESE ARE OUT OF ORDER (because "val 1" is so long).
2275         val 1   Host status
2276                 4.9     1 => RFNM wait on link 0.
2277                 4.8-4.3 Unused.
2278                 4.2-4.1 Host status:
2279                         0       Down.
2280                         1       RST sent.
2281                         2       Up.
2282                 3.9-3.1 Time (as returned by .RDTIME) modulo 1000
2283                         the last RFNM sent on link 0.
2284                 2.9-1.1 Last message from IMP about "host dead status"
2285                         for this host.  (See BBN Report #1822, Chapter 3.)
2286                         2.7-1.5 Time host will come back up, Greenwich Mean Time:
2287                                 2.7-2.5 Day of week (0=Monday, ..., 6=Sunday).
2288                                 2.4-1.9 Hour of day (0-23.).
2289                                 1.8-1.5 Five-minute interval within hour (0-11.).
2290                                 -1 means more than a week.
2291                                 -2 means time coming back up is unknown.
2292                         1.4-1.1 Reason host is down:
2293                                 1       Foreign host not communicating
2294                                         with network (took ready-line down
2295                                         without saying why).
2296                                 2       Foreign host not communicating with
2297                                         network (host was tardy in accepting
2298                                         network traffic without saying why).
2299                                 3       Foreign host does not exist, to the
2300                                         knowledge of the Network Control Center.
2301                                 4       The IMP software is preventing
2302                                         communication with foreign host
2303                                         (this usually indicates IMP software
2304                                         initialization at the foreign site).
2305                                 5       Foreign host down for scheduled P.M.
2306                                 6       Foreign host down for scheduled
2307                                         hardware work.
2308                                 7       Foreign host down for scheduled
2309                                         software work.
2310                                 10      Foreign host down for emergency restart.
2311                                 11      Foreign host down because of power outage.
2312                                 12      Foreign host stopped at software
2313                                         breakpoint.
2314                                 13      Foreign host down because of hardware
2315                                         failure.
2316                                 14      Foreign host not scheduled to be up.
2317                                 17      Foreign host in process of coming up.
2318
2319         If one argument is supplied, then the host status word
2320         for the specified host is returned.  If two arguments are
2321         supplied, then the "reason for going down" word for the
2322         local host is set.  (As of June 30, 1975, setting this
2323         word doesn't seem to do anything at all.  Didn't the code
2324         for sending this data to the IMP ever get written??)
2325 \f
2326 NETIMP: network IMP status                                      (ITS NCP)
2327
2328         If no arguments are present, three values are returned:
2329         val 1   Last message from IMP about going down.
2330                 4.9     IMP really is down now.
2331                 1.2-1.1 Reason:
2332                         0       "Last warning" or "panic restart";
2333                                 the IMP is going down in 30. seconds or less.
2334                         1       Scheduled hardware P.M.
2335                         2       Scheduled software reload.
2336                         3       Emergency restart.
2337         val 2   Time going down, as returned by .RDTIME.
2338         val 3   Time coming back up, as returned by .RDTIME.
2339
2340         If arguments are present, three must be present.
2341         They are used to set three default values which are returned
2342         if the IMP itself has not set the above three values.
2343         Presumably this is good for logically disabling network software?
2344
2345 Errors:
2346
2347 30      TOO FEW ARGUMENTS
2348         Must have either 3 arguments or no arguments.
2349 \f
2350 NETINT: Send network interrupt                  OBSOLETE        (ITS NCP)
2351
2352         This system call is obsolete, and has been flushed.
2353         It is documented here for historical purposes only.
2354
2355         arg 1   channel #
2356
2357         An INR or INS message is sent, depending on the send/receive
2358         gender of the socket specified by the channel #.  What this does
2359         depends on the protocol being used and the program at the
2360         other end of the connection.
2361
2362         This call only works for NCP and is obsolete.
2363 Errors:
2364
2365 34      WRONG TYPE DEVICE
2366         The channel specified is not an Arpanet NCP channel.
2367 \f
2368 NETRFC: Get pending Request For Connection for a specified network
2369
2370         cbits
2371                 %NQREF  Arg 2 is a previously returned identifier,
2372                         refuse connection and flush from queue.
2373         arg 1 - SIXBIT name of network
2374                 one of CHAOS, TCP, or ARPNCP (obsolete)
2375         arg 2 - optional network-dependent arg
2376                 for CHAOS: pointer to packet buffer
2377                 for TCP: If %NQREF set, is <id>,,<port #> of request to
2378                         reject (as returned from previous NETRFC call)
2379         val 1 - network-dependent value
2380                 for TCP: <id>,,<port #>
2381                 for ARPNCP: <id>,,<socket #>
2382
2383         This call is intended for use by very specialized programs
2384         which ITS invokes upon receiving unsolicited requests for
2385         connections.  ITS will queue the request for a short time
2386         and start an appropriate job which uses NETRFC to obtain
2387         the request and process it.  Currently these programs are
2388                 NCP:    SYS;ATSIGN NETRFC
2389                 TCP:    SYS;ATSIGN TCP
2390                 CHAOS:  SYS;ATSIGN CHAOS
2391
2392         Normally the program will execute a NETRFC appropriate for its
2393         network, and obtain a returned request value.  Accepting the
2394         request is device dependent, but refusal can always be done
2395         by calling NETRFC again with the %NQREF control bit set and
2396         furnishing the appropriate request identifier.
2397
2398         See the CHAOSQ system call, which NETRFC is replacing.
2399
2400 ERRORS
2401   4     - TCP: No pending RFCs, or %NQREF with non-existent <id>,,<port>.
2402  12     - CHAOS: can't handle %NQREF yet.
2403  33     - Unknown network specified.
2404 \f
2405 OPEN:   open a file
2406
2407         cbits   Device dependent. Standard bits are:
2408                 2.7-2.9 0 = normal, 1 = write-over mode.
2409                 1.3     0 = ascii, 1 = image.
2410                 1.2     0 = unit, 1 = block.
2411                 1.1     0 = read, 1 = write.
2412         arg 1   Channel number.  LH XOR'd with control bits.
2413         arg 2   Left-justified device name.
2414         arg 3   File name 1.
2415         arg 4   File name 2.
2416         arg 5   Sname.  If not present, defaults to executing
2417                 job's current sname (see the .SNAM user variable).
2418
2419         See also the .OPEN uuo.
2420
2421         The file names used for opening are subject to translation.
2422         See the TRANAD and TRANDL symbolic system calls.
2423
2424         The file names  .FILE. (DIR)  are special:
2425         they cause the directory for the given device
2426         (and sname, if applicable) to be read.  It is
2427         illegal to write the directory.  If a device has
2428         no directory, then opening  .FILE. (DIR)  will
2429         supply the string "NON-DIRECTORY DEVICE", presumably.
2430         (This is a function of the unknown-device handler
2431         (see below) and hence the exact results may vary).
2432         Opening a directory in ascii mode yields an
2433         ascii string for people to look at; opening it
2434         in image mode yields a device-dependent file
2435         (or possibly a MODE NOT AVAILABLE error).
2436
2437         For the DSK device, the control bits are:
2438         1.4     %DONRF  Don't set the reference date.
2439         1.5     %DONLK  Don't chase links.  (I. E., if
2440                         this is a link, open the link itself,
2441                         not the file at which the link points.
2442         1.6     %DORWT  Readers wait.  On output open, makes would-be
2443                         readers wait till we close.
2444         2.7     %DOWOV  Write-over mode.  Writes on the existing
2445                         file of that name, instead of replacing
2446                         it with a new file.
2447
2448         The file names  M.F.D. (FILE)  when opened for
2449         input yield a master file directory for all
2450         disks.  In ascii mode this is an ascii string
2451         containing the names of all directories, separated
2452         by a cr/lf sequence.
2453
2454         The file names  ..NEW. (UDIR)  cause a new directory
2455         to be created with the given sname if none already
2456         exists.  Creating a directory in this way causes a
2457         message to be printed on the system console.
2458         (A directory is destroyed only when the disks are
2459         salvaged by the stand-alone salvager, which is generally
2460         run just before the time-sharing system is restarted.
2461         A directory is then destroyed iff it contains no files.)
2462
2463         If  <  or  >  is used as a file name, it is treated
2464         specially according to an algorithm no one
2465         understands, but which attempts to let it stand
2466         for the numerically smallest or largest file name
2467         among those in the directory.  In particular,
2468         if you call your files  FOO nnn, where nnn is a version
2469         number, then reading  FOO >  will read in the latest
2470         version, writing  FOO >  will write out a version
2471         one higher than the latest one (or  FOO 1  if there
2472         is no file named  FOO nnn), and deleting  FOO <
2473         will delete the oldest one.  Writing FOO < doesn't
2474         recreate an old file; it is the same as FOO >.
2475         If a file with numbers and letters in its name,
2476         for example  FOO BAR27, already exists,
2477         writing  FOO >  will generate  FOO BAR28
2478         and not FOO 1.  Letters to the right of numbers are
2479         generally ignored as far as < and > are concerned.
2480
2481         Note that < and > may be used as first
2482         file names as well; this is mainly useful for the
2483         .LPTR. directory.  It is illegal to use  <  or  >  for
2484         both file names at once.
2485
2486         The SYS device ignores the sname, and otherwise
2487         is like using the device-sname pair  DSK:SYS; .
2488         Writing new files or altering old ones on the SYS
2489         device (or even on DSK:SYS;) causes a message to
2490         appear on the system console documenting who the
2491         culprit is and what he did.  This is because system
2492         programs and other files critical to system operation
2493         are kept on SYS:.  In fact this applies to writing
2494         or altering files on any disk directory whose name
2495         begins with the three letters "SYS".  Standard
2496         directories whose names begin with "SYS" include:
2497         SYS1    Extension for SYS directory (holds programs).
2498         SYS2    Extension for SYS directory (holds programs).
2499         SYS3    Extension for SYS directory (holds programs).
2500         SYSENG  Source files for many system programs.
2501         SYSEN1  Extension for SYSENG directory.
2502         SYSEN2  Extension for SYSENG directory.
2503         SYSBIN  Binary files for many system programs.
2504         SYSTEM  Files having to do with ITS itself.
2505         SYSDOC  Documentation for ITS itself.
2506         SYSNET  Files having to do with Chaosnet and TCP.
2507
2508         The COM device ignores the sname, and otherwise
2509         is like using the device-sname pair  DSK:COMMON; .
2510
2511         The TPL device ignores the sname, and otherwise
2512         is like using the device-sname pair  DSK:.LPTR.; .
2513         (On systems without lineprinters the TPL device is
2514         generally just a JOB device.)
2515         On output, it furthermore ignores the file names,
2516         and instead uses the uname of the opening job as
2517         the second file name, and randomly generates a
2518         first file name.  The system job prints files
2519         it finds on .LPTR. on the line printer, whenever it
2520         has nothing better to do and the line printer happens
2521         to be free; these files are subsequently deleted.
2522         Thus the TPL device provides a printer spooling facility.
2523         Attempts to rename a file on the TPL device are
2524         ignored, because the name controls the spooling order.
2525
2526         For the LPT device, opening succeeds only if no one
2527         has the LPT, or the same user already has the LPT;
2528         in the former case the opening job must be in a tree
2529         controlled by a "local" tty as defined by its TTYTYP
2530         variable.  In all other cases the OPEN is converted
2531         to use the TPL device instead.
2532
2533         For the USR device, the file names should be the
2534         uname-jname pair of the job to open.  If the uname is
2535         zero, it is equivalent to using the uname of the
2536         job doing the call.  If the jname is zero, then the
2537         uname is interpreted as a <JOB> specification;
2538         in this way one can open a job given its user index.
2539         A jname of PDP6 or PDP10 opens up the PDP-6
2540         as the "job".  (PDP10 as a jname goes back to the
2541         days when the PDP-6 ran ITS and the PDP-10 was the
2542         auxiliary processor!)
2543         Control bits:
2544         1.4     Insist on opening an already existing job;
2545                 i.e. do not create a new one.  The job will
2546                 be opened as a foreign job, not as an inferior.
2547         Here is an algorithm for deciding whether job Y will
2548         be a direct inferior or merely a foreign job when
2549         opened by job X:
2550                 (DEFUN USR-OPEN-RESULT (X Y BIT-1*4)
2551                        (COND (BIT-1*4 (COND ((EXISTS Y) 'FOREIGN)
2552                                             (T (ERROR))))
2553                              ((EXISTS Y)
2554                               (COND ((INFERIOR Y X) 'INFERIOR)
2555                                     ((DISOWNED X) 'FOREIGN)
2556                                     ((NOT (DISOWNED Y)) 'FOREIGN)
2557                                     ((TOPLEVEL Y)
2558                                      (MAKE-NON-DISOWNED Y)
2559                                      (CHANGE-ALL-UNAMES Y (UNAME X))
2560                                      (FIX-UP-TTY-CHANNELS Y)
2561                                      'INFERIOR)
2562                                     (T 'FOREIGN)))
2563                              ((= (UNAME X) (UNAME Y))
2564                               (CREATE-USR Y)
2565                               (AND (DISOWNED X)
2566                                    (MAKE-DISOWNED Y))
2567                               'INFERIOR)
2568                              (T (ERROR))))
2569
2570         For the ERR device, the first file name must be
2571         numerically 1, 2, 3, or 4.  If it is 1, then the .IOS
2572         word specified by the user variable .BCHN is
2573         examined.  If it is 2, the .IOS word for the channel
2574         numerically specified by the second file name is
2575         examined.  If it is 3, the second file name is itself
2576         the status word.  Bits 3.1-4.5 of the specified word
2577         yield a the number of an error message which can then
2578         be read from the open ERR device.  If the first file
2579         name is 4, the second file name must be the value
2580         returned into an error code return argument by a symbolic
2581         system .CALL that didn't skip.  The corresponding error
2582         message can be read from the open ERR device.
2583
2584         For TTY and Tnn devices (terminals in general),
2585         some of the control bits set first-time options,
2586         and some are per-channel.  Those which are per-channel
2587         are marked below with a *.  The standard names for
2588         these bits are also given.                      (ITS TTY)
2589         Control bits on input:
2590         2.6 *   %TIECH  Read even if char needs pi echoing
2591         2.5 *   %TIPEK  Don't remove char from buffer (peek)
2592         2.3 *   %TIACT  Don't wait for activation char
2593         2.2 *   %TIINT  Read even if char is an interrupt
2594                         char and hasn't interrupted yet.
2595
2596         2.1 *   %TINWT  Do not wait for input.  If no input
2597                         is available, return -1 in unit mode, or
2598                         return a partially filled block in block mode.
2599         1.9 *   %TIFUL  Use the full TV character set if possible.
2600                         In this mode, characters have this form:
2601                         2.3     %TXTOP  Top.
2602                         2.2     Obsolete.  Used to be Shift lock.
2603                         2.1     %TXSUP  Super.  Used to be Shift.
2604                         1.9     %TXMTA  Meta.
2605                         1.8     %TXCTL  Control.
2606                         1.7-1.1 %TXASC  Ascii part of character.
2607                         Of course, for non-TV's only %TXASC
2608                         will be non-zero.
2609         1.6     Set up 3 line echo area (like SCML of 3).
2610         1.4     "DDT" mode.  Initially clear the %TGPIE and
2611                 %TGMPE bits for carriage return, line feed,
2612                 and tab, thus causing them not to echo.
2613         1.3     Image mode.  Initially clear the %TGPIE
2614                 and %TGMPE bits for all characters.
2615         1.2     0 = unit mode, 1 = block mode.  In block mode,
2616                 ^C causes a block mode end of file.
2617         1.1     0 = input.
2618         Control bits on output:
2619         2.6 *   %TJECH  Echo mode output.
2620         2.5 *   %TJCTN  Don't do line continuation.
2621         2.4 *   %TJSTP  Channel is hung in **MORE**.
2622                 Unusual in that the system modifies this bit.
2623         2.3 *   %TJDIS  Recognize ^P cursor codes.
2624         2.2 *   %TJSIO  Super-image output.  No padding
2625                         or cursor control is performed.
2626         2.1 *   %TJMOR  Do not do **MORE** processing.
2627         1.9 *   %TJPP2  Output in the echo area if it exists.
2628         1.6     Same as 2.2 - turns on %TJSIO.
2629         1.5     Same as 2.3 - turns on %TJDIS.
2630         1.4     Turns on %TJECH, %TJPP2, %TJMOR.
2631         1.3     Image mode.  Initially set %TGIMG bits
2632                 for all characters.
2633         1.2     0 = unit mode, 1 = block mode.  In block mode
2634                 output all ^C's are ignored.
2635         1.1     1 = output.
2636
2637         For STY device input, control bit 1.4 means that
2638         input IOTs, instead of hanging, will input a -1 in
2639         unit mode or not count out the AOBJN pointer in block
2640         mode (see ITS TTY for details).
2641         For STY output, control bit 1.4 means that output IOTs,
2642         instead of hanging when the tty's input buffer is full,
2643         will cause a ^G to be output, just as on normal ttys.
2644         Control bit 1.5, on input or output, causes a %TDORS
2645         character to be available as input when an output
2646         reset is done on the sty's alter ego.
2647         Control bit 1.3 is copied into the %TOHDX bit of the
2648         associated tty, thus making it half-duplex if set.
2649         These control bits are not per-channel, but rather
2650         will affect all channels open on the same STY.
2651
2652         For the PTR and PTP devices (paper tape reader and
2653         punch), if the 1.4 control bit is on, then the 1.2 bit
2654         must be 0 and the 1.3 bit is ignored.  In this mode
2655         all eight paper tape channels may be read or punched.
2656
2657         For the NET device, the arguments are as follows:
2658         cbits   2.1-2.6 byte size for image mode
2659                 1.7     Use 8 times as large a buffer.
2660                 1.6     If ascii mode, use 8-bit bytes
2661                         instead of 7-bit bytes.
2662                         If image mode, use byte size in
2663                         bits 2.1-2.6.
2664                 1.5     Open socket in listen mode.
2665                 1.4     0 = use arg 3 as local socket number.
2666                         1 = generate unique local socket number.
2667                         (A generated socket number can be examined
2668                         after opening by using the .RCHST uuo).
2669                 1.1-1.3 Standard.
2670         arg 1   Channel number.
2671         arg 2   Left-justified device name (i.e. NET).
2672         arg 3   Local socket number.
2673         arg 4   Foreign socket number.
2674         arg 5   Foreign host number.
2675
2676         For the STK device (Stanford keyboard):
2677         cbits   1.7     If 1.6 = 1 and 1.5 = 0,
2678                         then don't input the meta bit.
2679                 1.6     0 = Stanford mode:
2680                                 meta = 400
2681                                 ctrl = 200
2682                                 top+shift+others generate 0-177
2683                         1 = ITS mode:
2684                                 meta = 200
2685                                 ctrl means ctrl, and works
2686                                 with others to generate 0-177
2687                 1.5     0 = convert according to 1.6-1.7.
2688                         1 = don't convert characters.
2689                 1.4     Don't hang if no character
2690                         available for input - return -1
2691                         instead.
2692
2693         If the device name used in the OPEN is not one known to
2694         to the system, the "unknown-device handler" is invoked.
2695         The system creates a job device and loads SYS:ATSIGN DEVICE
2696         into it; this program then has the responsibility for
2697         handling the OPEN.  The normal action of this program is
2698         to look for a file DSK:DEVICE;JOBDEV <name>, where <name>
2699         is the requested device name.  For example, if an attempt
2700         is made to OPEN the FOOBAR device, and the file
2701         DSK:DEVICE;JOBDEV FOOBAR exists, the program contained in
2702         this file will be used to interpret the OPEN via the JOB device.
2703         If such a file does not exist, but the device name has trailing
2704         digits, the unknown-device handler will try stripping successive
2705         trailing digits and retrying.  For example, opening the
2706         AR1 device causes the unknown-device handler to look first for
2707         JOBDEV AR1, and then for JOBDEV AR.  If the handler succeeds,
2708         it sets device name for PEEK and who-lines to the second
2709         file name that finally succeeded (see the JOBSTS symbolic
2710         system call).
2711         The unknown-device handler also handles requests for the
2712         directories of certain built-in devices whose directories
2713         are seldom asked for.  If there is nothing better to return for
2714         a directory, the string "NON-DIRECTORY DEVICE" is returned.
2715
2716 Errors:
2717
2718         OPEN can return many errors.  The following errors in
2719         particular are relevant to OPEN on the DSK device:
2720
2721   4     FILE NOT FOUND
2722         The specified directory exists, but the specified file
2723         does not.
2724   5     DIRECTORY FULL
2725         There is no room in the directory to create an entry
2726         for the new output file.
2727   7     DEVICE NOT READY
2728         The disk pack containing the file is offline (should
2729         never really happen).
2730  10     DEVICE NOT AVAILABLE
2731         a specific unit was selected, by opening DKn, and that
2732         unit is off-line or contains a reserved pack.  Or, a
2733         specific pack was selected by opening PKn or Pnn,
2734         and that pack is reserved.  The reserved-pack check
2735         only applies when writing.  Reserved means secondary-pack,
2736         or reserved for the exclusive use of certain directories.
2737  11     ILLEGAL FILE NAME
2738         One or both file names were zero; or, for an output file,
2739         the file names were M.F.D. (FILE) or .FILE. (DIR), which
2740         are names reserved for directories.
2741  12     MODE NOT AVAILABLE
2742         Control bits 2.9-2.7 specified an illegal mode.
2743  14     BAD CHANNEL NUMBER
2744         This is a RENMWO error.
2745  16     PACK NOT MOUNTED
2746         The pack specified by opening PKn or Pnn is not
2747         mounted, or the pack containing the file being read
2748         is not mounted.
2749  20     NON-EXISTENT DIRECTORY
2750         The specified directory does not exist.
2751  22     SELF-CONTRADICTORY OPEN
2752         Control bits 2.9-2.7 specified an illegal mode.
2753  23     FILE LOCKED
2754         An attempt to open a file in write-over mode failed
2755         because someone has the file open for reading; or
2756         an attempt to open a file for read, write-over, rename,
2757         or delete failed because someone is writing the file
2758         or because the file has been deleted, but hasn't gone
2759         away yet because someone is reading it (i.e. there is
2760         a star next to it in the directory listing.)  wait a while
2761         and try again.
2762  24     M.F.D. FULL
2763         Cannot create a new directory because the master file directory
2764         is full.
2765  27     LINK DEPTH EXCEEDED
2766         Links may not be chained to a length of greater than 100 links.
2767         This error probably means a circular chain of links.
2768  47     LINK TO NON-EXISTENT FILE
2769         Error 4 or 20 occurred after following a link.
2770 \f
2771 PDUMP:  pure dump a job
2772
2773         arg 1   <JOB>.
2774         arg 2   Disk output channel number.
2775                 Should have been freshly opened
2776                 for output.
2777         arg 3   State word; should be 0 initially.
2778                 This word is updated as the PDUMP
2779                 progresses; a value of 400000,,<n> means
2780                 that page <n> is about to be dumped.
2781
2782         The pages of the specified job are dumped onto
2783         the disk file in a form that can be efficiently
2784         loaded.  In particular, information as to whether
2785         each page is read-only or not is saved so that
2786         when the program is run it can be swapped
2787         efficiently.  If the same file is loaded into
2788         several jobs, they will all share the same
2789         physical copies of the read-only pages.
2790         In addition, absolute pages are remembered.
2791         A number of 2000-word (1K) blocks are dumped onto
2792         the file.  The first block is as follows:
2793         wd 0            Contains zero.  This distinguishes
2794                         PDUMP'ed programs from, for example,
2795                         MIDAS output.
2796         wds 1-400       Word <n> contains information about
2797                         block <n-1> of the dumped job.  This
2798                         information is as follows:
2799                         4.9     Absolute page (shared with system).
2800                         2.9-2.8 00      Non-existent page.
2801                                 01      Read-only page.
2802                                 10,11   Read/write page.
2803                         2.2-1.1 If 4.9=1, absolute page number.
2804         wds 401-777     Zero.
2805         wds 1000-1017   The contents of the accumulators.
2806                         Note that the accumulators aren't part of
2807                         any page, so they wouldn't be saved if it were
2808                         not for this special hack.
2809         The following blocks of the file are the successive
2810         pages of the job, but only those which need to be dumped.
2811         That is, absolute and non-existent pages are not dumped.
2812         Thus, suppose the pages of a job are laid out as follows:
2813                 pg 0    Read/write.
2814                 pg 1-5  Read-only.
2815                 pg 6-7  Absolute (e.g., system symbol table).
2816                 pg 100  Read/write.
2817                 pg 200  Read/write.
2818                 others  Non-existent.
2819         Then nine blocks would be dumped out:
2820                 blk 0   Descriptor block.
2821                 blk 1   Page 0.
2822                 blk 2-6 Pages 1-5.
2823                 blk 7   Page 100 (octal).
2824                 blk 10  Page 200 (octal).
2825         This is all that PDUMP writes out, leaving the file's access
2826         pointer at the end of the last block written.  At this point
2827         the job doing the PDUMP will normally write out the
2828         symbol table, if any, for the dumped job onto the disk
2829         channel, preceded and followed by JUMPA instructions
2830         containing the starting address.  When this is done,
2831         the resulting file can be loaded and run as a program
2832         under DDT.
2833         See the LOAD symbolic system call.
2834
2835 Errors:
2836
2837  14     BAD CHANNEL NUMBER
2838  31     CAN'T MODIFY JOB
2839         Can't dump the PDP-6 job.
2840  34     WRONG TYPE DEVICE
2841         First argument was some oddball channel, or
2842         second argument was not a disk output channel number.
2843  35     NO SUCH JOB
2844 \f
2845 PGWRIT: Cause page to be written to disk
2846
2847         arg 1   (Optional)  A <JOB>
2848         arg 2   Virtual page number within that job (a number from 0 to 377).
2849         control bits:
2850         1.1     1 => don't wait for the page to finish getting written out,
2851                      return immediately.  Issue the call again with this bit 0
2852                      if you later want to wait for it to get written out.
2853         1.2     1 => unlock the page.
2854                 0 => if the page is locked, swap it out anyway, but when it
2855                      next gets swapped in again it will be locked again.
2856
2857         If there is only one argument, it is arg 2.  The <JOB> is
2858         assumed to be the job issuing the call.
2859
2860         The disk copy of the specified page is brought up to date;
2861         if the in-core copy has been modified by the specified <JOB>
2862         the page is written out.  The PGDUMP call does not return until
2863         the disk has finished recording the page.
2864
2865         This is useful when pages of a file have been mapped into
2866         the user's address space.
2867
2868         If the page cannot be swapped out because no disk space is available,
2869         or some job that is using it cannot be pclsr'ed, it waits a while
2870         and tries again.  It does not return.
2871
2872         This call used to be called PGDUMP, but the name was
2873         changed to avoid confusion with PDUMP.
2874
2875 Errors:
2876
2877  12     MODE NOT AVAILABLE
2878         Page is absolute or tied down by exec pages.
2879  14     BAD CHANNEL NUMBER
2880         The <JOB> argument is invalid.
2881  31     CAN'T MODIFY JOB
2882         Executing job doesn't have modification rights to the job
2883         specified by argument 1.
2884  32     CAN'T GET THAT ACCESS TO PAGE
2885         The page number in argument 2 is not between 0 and 377; or the
2886         job does not have a page at that position in its address space.
2887  34     WRONG TYPE DEVICE
2888         The <JOB> specifies the pdp-6, which does not have paging.
2889  35     NO SUCH JOB
2890         The <JOB> argument specified a non-existent job.
2891 \f
2892 PKTIOT: transfer one Chaosnet packet                    <MOON;CHAORD>
2893         arg 1 - channel number
2894         arg 2 - address of a 126.-word block.
2895
2896         Always transfers exactly one packet.
2897         The format of the 126.-word block is:
2898                          16               16          4
2899                 -----------------------------------------
2900                 | opcode | unused | fc |   nbytes   | 0 |
2901                 -----------------------------------------
2902                 |destination host |destination index| 0 |
2903                 -----------------------------------------
2904                 |   source host   |   source index  | 0 |
2905                 -----------------------------------------
2906                 |    packet #     |  ack packet #   | 0 |
2907                 -----------------------------------------
2908                 | data1  |  data2  ...
2909         
2910                                             ... data487 |
2911                 -----------------------------------------
2912
2913         For details of how to use these packets, see the Chaosnet
2914         protocol documentation.
2915 \f
2916 RAUTH:  read a file's author.
2917
2918         arg 1   Number of a channel open on the DSK device,
2919                 or a <JOBDEV>.
2920
2921         val 1   Sixbit name of the file's author (the last
2922                 person to write on the file.)
2923 \f
2924 RCHST:  read channel status.
2925         Note:  This system call is obsolete.  Use the RFNAME,
2926                 RFPNTR, or WHYINT system call to obtain the
2927                 information you want.
2928
2929         arg 1   channel number
2930
2931         val 1   The fullword sixbit name of the device open
2932                 on the specified channel, or 0 if the channel
2933                 is closed.
2934         val 2   The first file name of the file open on the
2935                 channel, or 0 if filenames mean nothing on
2936                 the device which is open.
2937         val 3   The second file name, or 0.
2938         val 4   The directory name of the open file, assuming
2939                 that "directory name" has some meaning for the
2940                 device which is in use; otherwise, 0.
2941         val 5   The channel's access pointer, if it is randomly
2942                 accessible; otherwise, -1.
2943         val 6...additional device-dependent results
2944
2945         The values may not be the same as the filenames, etc.
2946         that were used to open the channel.  The results of
2947         this call are quite device-dependent.
2948         in the open-mode returned by RCHST.
2949
2950         The following devices return the access pointer as -1
2951         and the filenames and directory name as 0:
2952         NUL     LPT     NVD     PLT     PTP     IMX     OMX
2953         PTR     DIS     IDS     COD     TVC     TAB     MT0
2954         MSP     STK
2955
2956         The data stored by other specific devices is described below.
2957         If a specific numbered value is not mentioned, then the default
2958         is returned by that device - 0 for values 2, 3 and 4;
2959         -1, for value 5.
2960
2961         DIRECTORIES
2962         val 1   The device name
2963         val 2   sixbit/.FILE./
2964         val 3   sixbit/(DIR)/
2965         val 4   the directory name, on a multi-directory device
2966
2967         DISK MFD's
2968         val 1   sixbit/DSK/
2969         val 2   sixbit/M.F.D./
2970         val 3   sixbit/(FILE)/
2971
2972         ERR
2973         val 1   'ERR,,
2974         val 2   3
2975         val 3   a word in the format of a channel status word,
2976                 which has the error codes that the ERR device
2977                 is describing.
2978
2979         Closed channel:
2980         vals 1-4 0
2981         val 5   -1
2982
2983         TTY (as a console)
2984         val 1   'TTY,,
2985
2986         TTY (as a device)
2987         val 1   'Tnm,,
2988
2989         STY
2990         val 1   'Snm,,
2991
2992         USR (including PDP-6)
2993         val 1   'USR,,
2994         val 2   Uname of job.
2995         val 3   Jname of job.
2996         val 4   0
2997         val 5   Access pointer.
2998
2999         UTn (micro-tape)
3000         val 1   'UTn,,
3001         val 2   File name 1.
3002         val 3   File name 2.
3003         val 4   Uname assigned to, or zero if none (see the .ASSIGN uuo).
3004
3005         CLI, CLO, CLA, CLU
3006         val 1   'CLO,,
3007         val 2   File name 1.
3008         val 3   File name 2.
3009         val 4   Sname.
3010
3011         DSK
3012         val 1   'DSK,,
3013         val 2   File name 1.
3014         val 3   File name 2.
3015         val 4   Directory name.
3016         val 5   Access pointer.  May be a byte pointer if character mode.
3017
3018         BOJ
3019         val 1   'BOJ,,
3020         val 2   Uname of creator (zero if he has gone away).
3021         val 3   Jname of creator (zero if he has gone away).
3022
3023         JOB
3024         vals 1-n        Whatever the job device decides to return.
3025                 See the JOBSTS and JOBRET symbolic system calls.
3026                 Note that the job sets the results for vals 1-4 once
3027                 using the JOBSTS call, and only the values 5, 6, ...
3028                 are taken from the JOBRET that responds to the RCHST.
3029
3030         NET
3031         val 1   'NET,,
3032         val 2   Local socket number.
3033         val 3   Foreign socket number.
3034         val 4   4.9     Network interrupt (INR/INS) received.
3035                 2.9-2.1 Byte size.
3036                 1.9-1.1 Foreign host number.
3037         val 5   4.9-3.1 Time until IMP goes down, in thirtieths
3038                         of a second.
3039                         0 => IMP down.
3040                         -1 => IMP doesn't plan to go down.
3041                 2.9-1.1 Socket state:
3042                         0       %NSCLS  CLS received.  val 6 gives reason.
3043                         1       %NSLSN  Listening for RFC.
3044                         2       %NSRFC  RFC received while listening.
3045                         3       %NSRCL  CLS received while in RFC received state.
3046                         4       %NSRFS  RFC sent.
3047                         5       %NSOPN  Connection open.
3048                         6       %NSRFN  RFNM wait on write link.
3049                         7       %NSCLW  CLS sent.  Waiting for matching CLS.
3050                         10      %NSCLI  CLS received, but input still available.
3051                         11      %NSINP  Input available.
3052         val 7   Reason for closing:
3053                 0       %NCNTO  Never open.
3054                 1       %NCUSR  Closed by user.
3055                 2       %NCFRN  Closed by foreign host.
3056                 3       %NCRST  Foreign host Reset itself.
3057                 4       %NCDED  Foreign host dead.
3058                 5       %NCINC  Incomplete transmission.
3059                 6       %NCBYT  Byte size mismatch.
3060                 7       %NCNCP  Local NCP went down.
3061                 10      %NCRFS  Connection refused.
3062         val 8   Input: number of bits available.
3063                 Output: number of bits of buffer free.
3064
3065         TCP: (Internet TCP)
3066         val 1   SIXBIT /TCP/
3067         val 2   Local port #
3068         val 3   Foreign port #
3069         val 4   Foreign net address (HOSTS3 format)
3070
3071         Chaosnet:
3072         val 1   SIXBIT /CHAOS/
3073         val 2   Local index
3074         val 3   Foreign index
3075         val 4   Foreign net address (HOSTS3 format)
3076
3077         SPY:
3078         val 1   SIXBIT /SPY/
3079         val 2   TTY number
3080 \f
3081 RCPOS:  read cursor position                                    (ITS TTY)
3082
3083         arg 1   <TTY> or <JOBDEV>
3084         val 1   Main program area cursor position.
3085         val 2   Echo area cursor position.
3086
3087         Each cursor position is returned as a word with the
3088         vertical position in the left half and the horizontal
3089         position in the right half.
3090         See the SCML symbolic system call for setting up an
3091         echo area.
3092 \f
3093 RDDMST: read demon status
3094
3095         arg 1   Either the sixbit name or the user index
3096                 of a demon job.
3097         val 1   If arg 1 was the sixbit name, the user index;
3098                 if it was the user index, the sixbit name.
3099         val 2   4.9-3.1 If non-zero, the time in two-minute ticks
3100                         between automatic signals for the demon.
3101                 2.9-1.1 Number of requests pending for the demon.
3102         val 3   Time in two-minute ticks until the next automatic
3103                 signal will occur (meaningful only if arg 2 bits
3104                 4.9-3.1 not zero).
3105
3106         See also the DEMSIG and STDMST symbolic system calls,
3107         and the .DEMON uuo.
3108 \f
3109 RDMPBT: read dump bit
3110
3111         arg 1   Disk channel number or <JOBDEV>
3112         val 1   A word, all zero, except with the dump check
3113                 bit for the file in bit 1.1.
3114
3115         The dump check bit is used by the magtape file backup
3116         system to keep track of which files have been backed
3117         up on magtape.  This bit therefore should not be
3118         twiddled light-heartedly.  The "!" you sometimes see
3119         in front of a date in a disk file directory is present
3120         iff the dump check bit for the file is zero.
3121
3122         See also the .DMPCH uuo and the SDMPBT
3123         symbolic system call.
3124 \f
3125 RELOAD: reload top-level job                                    (ITS DETACH)
3126
3127         No arguments or values.  Note, however, that an
3128         argument of some kind must be supplied so that the
3129         SETZ bit may be present to terminate the set of
3130         arguments.
3131
3132         The executing job must be the top level job of
3133         a non-disowned job tree.
3134
3135         Most of the job's system variables are initialized;
3136         the file  SYS:ATSIGN <jname>  is then loaded and
3137         started up, where <jname> is the jname of the job
3138         (see the .JNAME user variable).
3139         For example, if the jname of the job is HACTRN,
3140         then the file  SYS:ATSIGN HACTRN  (which is DDT)
3141         is loaded and started.  This is how DDT performs
3142         the \eU. command.  Note that the translation lists for
3143         the job are not cleared before this loading; thus one
3144         can translate the file names  SYS:ATSIGN <jname>  and
3145         cause a different file to be loaded.
3146
3147         More specifically, the way the job is loaded is that
3148         the following program is put into the job's ac's
3149         and started at location 0:
3150
3151         0/      JFCL            ;unused word
3152         1/      .OPEN 1,7       ;open up file SYS:ATSIGN <jname>
3153         2/       JRST 0         ;retry on failure
3154         3/      .CALL 12        ;load up program
3155         4/       .LOGOUT        ;logout if loading fails
3156         5/      .IOT 1,2        ;read in starting address
3157         6/      JRST (2)        ;go there
3158         7/      4,,'SYS         ;SYS device, image unit input
3159         10/     SIXBIT \ATSIGN\
3160         11/     0               ;<jname> is placed here
3161         12/     SETZ
3162         13/     SIXBIT \LOAD\   ;load file into job
3163         14/     16              ;job specification
3164         15/     SETZ 17         ;channel number
3165         16/     -1              ;job is me
3166         17/     1               ;channel number is 1
3167
3168         Typically the first thing a job used as a top level
3169         (such as DDT) does is close channel 1.  Now you know
3170         why.  The LOAD system call leaves channel 1 open
3171         so that the start address and symbol table can be
3172         read in.
3173
3174 Errors:
3175
3176  40     NOT TOP LEVEL
3177 \f
3178 RENAME: rename a file
3179
3180   Either
3181         arg 1   Byte pointer to ASCIZ string specifying the old name,
3182                 or AOBJN pointer to block of byte pointers,
3183         arg 2   Byte pointer to ASCIZ string specifying the new name,
3184                 or AOBJN pointer to block of byte pointers,
3185
3186   Or
3187         arg 1   Left-justified device name.
3188         arg 2   Old file name 1.
3189         arg 3   Old file name 2.
3190         arg 4   Sname.  If zero, the executing job's sname
3191                 is used (see the .SNAM user variable).
3192         arg 5   New file name 1.
3193         arg 6   New file name 2.
3194
3195         The file specified by the first four names is renamed
3196         according to the last two.  It is not possible to
3197         "rename" a file into a new directory or device.
3198         Attempting to rename to an already existing file will
3199         fail with error code 13 (File already exists).
3200
3201         The old file names are subject to file name translation.
3202         See the TRANAD and TRANDL symbolic system calls.
3203
3204         See the SOPEN symbolic system call for how the byte or AOBJN
3205         pointer argument should be formatted and how the string(s) are
3206         parsed.
3207
3208         See also the .FDELE uuo.
3209 \f
3210 RENMWO: rename while open
3211
3212   Either
3213         arg 1   Channel number of channel with file open on it.
3214         arg 2   Byte pointer to ASCIZ string specifying the new name,
3215                 or AOBJN pointer to block of byte pointers,
3216
3217   Or
3218         arg 1   Channel number of channel with file open on it.
3219         arg 2   New file name 1.
3220         arg 3   New file name 2.
3221
3222         The file open on the specified channel is renamed
3223         according to the specified names.
3224
3225         Ordinarily this is used in connection with output.  Often
3226         one opens a file for output with artificial file names, for
3227         instance _TECO_ OUTPUT, instead of the real desired names.
3228         This is so that if something should happen, causing the
3229         channel to be closed before writing to the file is finished,
3230         any previous file with the desired names will not be
3231         replaced by the new, incomplete file.  When all the
3232         necessary data have been written into the file,
3233         one RENMWO's to the desired names and then CLOSE's.
3234         This causes the new, good file to replace the old one of
3235         the same names.  (By convention, file names beginning
3236         with "_" are artificial names reserved for this purpose.
3237         Ordinarily a program FOO will use the first file name
3238         _FOO_ and a second file name indicating the nature of
3239         the output file; thus _FOO_ OUTPUT, _FOO_ CRFOUT,
3240         _FOO_ LSTOUT, etc.)
3241
3242         See the SOPEN symbolic system call for how the byte or AOBJN
3243         pointer argument should be formatted and how the string(s) are
3244         parsed.
3245
3246         See also the .FDELE uuo.
3247 \f
3248 REOWN:  re-own a disowned job
3249
3250         arg 1   channel #
3251
3252         The foreign job open on the specified channel is made
3253         an inferior of the current job.  The sub-tree of that job
3254         becomes part of the sub-tree of the current job.  The UNAMEs
3255         of the specified job and all its inferiors are changed to
3256         the UNAME of the current job.  The JNAMEs are altered where
3257         necessary to keep all UNAME-JNAME pairs in the system unique.
3258
3259 Errors:
3260
3261 5       DIRECTORY FULL
3262         The current job already has the maximum number of inferiors (8).
3263 31      CAN'T MODIFY JOB
3264         The specified job is not top-level, or not disowned.
3265 34      WRONG TYPE DEVICE
3266         Specified channel is not open on the USR device,
3267         or the job is already an inferior of the current job.
3268 42      JOB GONE OR GOING AWAY
3269         The specified job is in the process of logging out.
3270 \f
3271 RESET:  reset input/output channel
3272
3273         arg 1   Channel number.
3274
3275         See also the .RESET uuo.
3276
3277         This is a device-dependent operation.  In general
3278         the intent is to reset the state of the device to
3279         some standard setting.
3280
3281         For TTY input:
3282         If the particular TTY involved is the console,
3283         wait until the executing job possesses the tty.
3284         (If the %TBINT bit is set for the job, give a
3285         word 1 interrupt on bit 4.2 if the job doesn't
3286         have the tty.)  If the TTY is in communicate mode,
3287         wait until it leaves communicate mode.
3288         All characters pending in the input buffer are
3289         thrown away.  Any interrupt characters which have
3290         not yet interrupted will not interrupt.  Any echoing
3291         characters which have not yet echoed will not echo.
3292
3293         For TTY output:
3294         If the particular TTY involved is the console,
3295         wait until the executing job possesses the tty.
3296         (If the %TBINT bit is set for the job, give a
3297         word 1 interrupt on bit 4.2 if the job doesn't
3298         have the tty.)  If the TTY is in communicate mode,
3299         wait until it leaves communicate mode.
3300         Any characters in the output buffer are thrown away
3301         iff the %TPORS bit is 1.  If the channel was hung in
3302         a **MORE**, the **MORE** is forgotten.  If the job
3303         was interrupted in the middle of ^P code typeout,
3304         the ^P is forgotten.  Other oddball state bits are
3305         also reset to their normal state.
3306         If the intelligent terminal protocol is in use on
3307         the tty, then a %TDORS code will be sent to it,
3308         and a reply stating the terminal's actual cursor
3309         position awaited before any more output is allowed.
3310         See the description of this protocol in the TTY documentation.
3311
3312         For the USR device:
3313         This is like doing a .UCLOSE and then re-opening the
3314         job, but with less overhead.  All pages of the job
3315         are flushed, and a single page, page 0, is created
3316         and cleared.  All resource variables and other variables
3317         are initialized.  The %TBNOT and %TBDTY bits are set
3318         in the .TTY variable.  The .SNAM variable is initialized
3319         to the uname of the job.  The .40ADDR variable is set
3320         to 40 octal.  The .APRC variable is set to 447 octal.
3321
3322         For the LPT device:
3323         The line currently being physically output is terminated
3324         and output.  All characters pending in the output buffer
3325         are flushed.  The printer is skipped to a new page.
3326
3327         For the PLT device:
3328         All buffered plotter commands are flushed.
3329
3330         For the PTR device:
3331         All buffered input characters are flushed.
3332
3333         For the PTP device:
3334         All buffered output characters are flushed.
3335
3336         For the COD device:
3337         All buffered output characters are flushed.
3338
3339         For the PDP-6:
3340         The core of the PDP-6 is cleared.  If it is running,
3341         this should cause it to loop, executing the zero word
3342         in location 41.  A routine is then placed in core to
3343         clear the PI flags, clear the processor flags, release
3344         all shared devices, clear the accumulators, and finally
3345         clear itself from core.  If the routine fails to run
3346         (the PDP-6 is not running), then the routine is cleared
3347         out of the PDP-6 memory again anyway.
3348
3349         For the NET device:
3350         Any pending interrupt (INR or INS) is cleared.
3351
3352         For TCP channels:
3353         Currently does nothing.
3354
3355         For the Chaosnet (channels opened with CHAOSO):
3356         Does nothing.
3357
3358         For the STY device:
3359         An input reset is much like an output reset for the
3360         tty which is the STY's alter ego; similarly, an output
3361         reset is much like an input reset for the associated tty.
3362         One difference is that a STY input reset does not
3363         reset certain channel-related bits that a tty output
3364         reset would; on the other hand, it always succeeds in
3365         flushing characters even if the %TPORS bit is not set.
3366
3367         For the STK device:
3368         All buffered input characters are flushed.
3369 \f
3370 RESRDT: restore file reference date
3371
3372         arg 1   Disk channel number or <JOBDEV>
3373
3374         The reference date for the disk file is restored to
3375         its value prior to the opening of the file.
3376         Note that control bit 1.4 avoids setting the
3377         reference date when a disk file is opened.  See
3378         the OPEN symbolic system call.
3379
3380         See also the DSKUPD, FILBLK, RQDATE and SRDATE symbolic
3381         system calls.
3382 \f
3383 RFDATE: read file creation date
3384
3385         arg 1   Disk channel number or <JOBDEV>
3386         val 1   The creation date of the file:
3387                 4.7-4.1 Year (mod 100.).
3388                 3.9-3.6 Month (January = 1).
3389                 3.5-3.1 Day of month.
3390                 2.9-1.1 Time of creation, in half-seconds
3391                         after midnight.
3392
3393         See also the RQDATE and SFDATE symbolic system calls.
3394 \f
3395 RFNAME: read name of file channel is open to
3396
3397         arg 1   <JOB> whose channel should be read. (OPTIONAL)
3398                 If omitted, self is assumed.
3399         arg 2   channel number
3400         arg 3   Optional byte pointer to store ASCIZ filename string through.
3401         arg 4   Optional maximum number of characters to store.
3402
3403         val 1   The fullword sixbit name of the device open
3404                 on the specified channel, or 0 if the channel
3405                 is closed.
3406         val 2   The first file name of the file open on the
3407                 channel, or 0 if filenames mean nothing on
3408                 the device which is open.
3409         val 3   The second file name, or 0.
3410         val 4   The directory name of the open file, assuming
3411                 that "directory name" has some meaning for the
3412                 device which is in use; otherwise, 0.
3413         val 5   The mode in which the channel is open.
3414
3415         The filenames and mode as described by the RFNAME may
3416         not be the same as those specified in the original open.
3417         That is because they are intended to be the "real"
3418         filenames, etc., as opposed to those that were specified.
3419         In other words, they are supposed to be the canonical
3420         arguments to specify to attempt to re-open the file.
3421         For example, the results of filename translation and
3422         link following will show up in the names returned by
3423         RFNAME, as opposed to the translated names or the names
3424         of the link that was followed.  Similarly, if COM or SYS
3425         is opened, RFNAME will return DSK:COMMON; or DSK:SYS;
3426         since COM and SYS are equivalent to those disk directories.
3427         The core link devices CLO, CLU, CLA and CLI
3428         perform different functions when first opened, but after the
3429         open they result in indistinguishable channels, and the file
3430         could be re-opened in any case by specifying CLO with the
3431         right filenames, so RFNAME will for all four devices return
3432         the device name CLO.
3433         Some open-mode bits also have only an initial effect, and
3434         they too are likely to be missing (or else always present!)
3435         in the open-mode returned by RFNAME.
3436
3437
3438         The following devices return the filenames and directory name as 0:
3439         NUL     LPT     NVD     PLT     PTP     IMX     OMX
3440         PTR     DIS     IDS     COD     TVC     TAB     MT0
3441         MSP     STK
3442
3443         The data stored by other specific devices is described below.
3444         If a specific numbered value is not mentioned, then the default
3445         is returned by that device - 0 for values 2, 3 and 4;
3446         bits 1.1, 1.2, 1.3 with their standard meanings
3447         for the open-mode (value 5).
3448
3449         DIRECTORIES
3450         val 1   The device name
3451         val 2   sixbit/.FILE./
3452         val 3   sixbit/(DIR)/
3453         val 4   the directory name, on a multi-directory device
3454
3455         DISK MFD's
3456         val 1   'DSK,,
3457         val 2   sixbit/M.F.D./
3458         val 3   sixbit/(FILE)/
3459
3460         ERR
3461         val 1   'ERR,,
3462         val 2   3
3463         val 3   a word in the format of a channel status word,
3464                 which has the error codes that the ERR device
3465                 is describing.
3466
3467         Closed channel:
3468         vals 1-5 0
3469
3470         TTY (as a console)
3471         val 1   'TTY,,
3472         val 5   see TTY as a device
3473
3474         TTY (as a device)
3475         val 1   'Tnm,,
3476         val 5   Bits 1.1 and 1.2 are standard.
3477                 For output channels, all the %TJ... bits
3478                 are returned also as they were in the OPEN.
3479                 For input channels, all the %TI... bits are
3480                 returned as they were specfied in the OPEN.
3481
3482         STY
3483         val 1   'Snm,,
3484         val 5   All the bits of a STY open are returned.
3485
3486         USR (including PDP-6)
3487         val 1   'USR,,
3488         val 2   Uname of job.
3489         val 3   Jname of job.
3490         val 4   0
3491         val 5   bits 1.1 and 1.2 as standard
3492                 bit 1.4 1 if the job is not an inferior
3493                 of the job which has it open.
3494
3495         UTn (micro-tape)
3496         val 1   'UTn,,
3497         val 2   File name 1.
3498         val 3   File name 2.
3499         val 4   Uname assigned to, or zero if none (see the .ASSIGN uuo).
3500
3501         CLI, CLO, CLA, CLU
3502         val 1   'CLO,,
3503         val 2   File name 1.
3504         val 3   File name 2.
3505         val 4   Sname.
3506
3507         DSK
3508         val 1   'DSK,,
3509         val 2   File name 1.
3510         val 3   File name 2.
3511         val 4   Directory name.
3512
3513         BOJ
3514         val 1   'BOJ,,
3515         val 2   Uname of creator (zero if he has gone away).
3516         val 3   Jname of creator (zero if he has gone away).
3517
3518         JOB
3519         vals 1-n        Whatever the job device decides to return.
3520                 See the JOBSTS system call.  Note that the JOB device
3521                 is not specifically consulted when the RFNAME call is
3522                 given; it sets up the file names and open mode once
3523                 and then these values are returned whenever a user
3524                 asks for them with RFNAME.
3525
3526         NET: (Arpanet NCP)
3527         Note that val 4 is slightly nonstandard.
3528         val 1   'NET,,
3529         val 2   Local socket number.
3530         val 3   Foreign socket number.
3531         val 4   4.9     Network interrupt (INR/INS) received.
3532                 2.9-2.1 Byte size.
3533                 1.9-1.1 Foreign host number.
3534
3535         TCP: (Internet TCP)
3536         val 1   SIXBIT /TCP/
3537         val 2   Local port #
3538         val 3   Foreign port #
3539         val 4   Foreign net address (HOSTS3 format)
3540
3541         Chaosnet:
3542         val 1   SIXBIT /CHAOS/
3543         val 2   Local index
3544         val 3   Foreign index
3545         val 4   Foreign net address (HOSTS3 format)
3546         val 5   0 or 1  (i.e. .UAI or .UAO)
3547
3548         SPY:
3549         val 1   SIXBIT /SPY/
3550         val 2   TTY number
3551 \f
3552 RFPNTR: read channel's random access pointer
3553
3554         arg 1   channel # (or <JOBDEV>)
3555
3556         val 1   random access pointer
3557         val 2   channel byte size.  The acces pointer
3558                 is in terms of bytes of this size.
3559
3560         The random access pointer is the number of bytes
3561         into the file at which the next reading or writing
3562         operation will occur.
3563
3564         See also the ACCESS system call, the .ACCESS UUO,
3565         the RCHST system call, and the .RCHST UUO.
3566
3567 Errors:
3568
3569 34      WRONG TYPE DEVICE
3570         The device open on the specified channel is not random-access.
3571 \f
3572 RQDATE: read disk format date
3573
3574         val 1   Current date and time in disk format:
3575                 4.7-4.1 Year (mod 100.).
3576                 3.9-3.6 Month (January = 1).
3577                 3.5-3.1 Day of month.
3578                 2.9-1.1 Time in half-seconds after midnight.
3579                 If date and time are unknown, -1 is returned.
3580         val 2   Date and time the system came up in disk format.
3581                 If date and time are unknown, -1 is returned.
3582
3583         See also the DSKUPD, FILBLK, RESRDT, RFDATE, and SFDATE
3584         symbolic system calls.
3585 \f
3586 RSSIZE: read screen size                                        (ITS TTY)
3587
3588         arg 1   <TTY> or <JOBDEV>
3589         val 1   Vertical size of screen (huge if printing).
3590         val 2   Horizontal size of screen (print width).
3591
3592         See also the CNSGET and CNSSET symbolic system calls.
3593 \f
3594 SAUTH:  set a file's author
3595
3596         arg 1   The number of a channel open on the DSK
3597                 device, or a <JOBDEV>.
3598
3599         arg 2   The sixbit name of the file's author.
3600
3601         Note:  the author is actually stored as a directory
3602         number, so if the author does not have a directory
3603         SIXBIT /______/ will be substituted.  Trailing digits
3604         are deleted in an attempt to find the author's directory.
3605 \f
3606 SCML:   set the number of TTY command lines                     (ITS TTY)
3607
3608         arg 1   <TTY> or <JOBDEV>
3609         arg 2   Number of command lines (typical value is 4).
3610                 Must be less than the height of the screen.
3611                 If zero, no echo area.
3612
3613         This causes an echo area to be set up at the bottom
3614         of the display screen, using the last <n> lines.
3615         Characters typed in, or characters output in echo
3616         mode, are output to this area rather than the main area.
3617         Note that control bit 1.6 in an OPEN symbolic
3618         system call for TTY input does an implicit SCML
3619         with a second argument of 3.
3620 \f
3621 SCPOS:  set tty cursor position                                 (ITS TTY)
3622
3623         arg 1   <TTY> or <JOBDEV>
3624         arg 2   vertical position (optional).
3625         arg 3   horizontal position (optional).
3626         arg 4   TTOALC word (optional).
3627         val 1   old vertical position.
3628         val 2   old horixontal position.
3629         val 3   old TTOALC word.
3630
3631         This call tells the system what the main-program-level
3632         cursor position of the specified tty really is.  It
3633         does NOT request that the cursor be MOVED there;
3634         it asserts that the cursor is expected to end up there
3635         as a result of the characters already IOT'ed.
3636         This call is necessary only when the system cannot figure
3637         the resulting cursor position out for itself.
3638         There are two cases when that happens:
3639
3640         1) The system does not compute cursor motion when
3641         super-image output is done.  If the user program, which
3642         presumably knows how the characters are being used, knows
3643         that the cursor will be moved by them, it should inform
3644         the system.  This is necessary even if the user program
3645         is just trying to save time by generating the internal
3646         system output buffer codes itself.
3647
3648         2) When an output reset is done on a tty of type %TNSFW
3649         (a "software tty"), the system does not know where the
3650         tty's cursor is physically located.  Since the system
3651         does not actually interpret the output characters at
3652         interrupt level, but merely passes them off to the
3653         tty, it does not know how much the tty had done when
3654         the output reset happened.  To recover, the system
3655         sets the LH of the tty's TTOALC word to 0, and sends
3656         a %TDORS character to the tty.  The tty should respond by
3657         informing the system of the current cursor position and
3658         setting the LH of TTOALC to -1.  Physical ttys must
3659         use the intelligent terminal protocol to do that,
3660         but STY users may do it with SCPOS.
3661 \f
3662 SDMPBT: set dump bit
3663
3664         arg 1   Disk channel number or <JOBDEV>
3665         arg 2   A word with the new value for the dump check
3666                 bit in bit 1.1.
3667
3668         The dump check bit is used by the magtape file backup
3669         system to keep track of which files have been backed
3670         up on magtape.  This bit therefore should not be
3671         twiddled light-heartedly.  The "!" you sometimes see
3672         in front of a date in a disk file directory is present
3673         iff the dump check bit for the file is zero.
3674
3675         See also the .DMPCH uuo and the RDMPBT
3676         symbolic system call.
3677 \f
3678 SETIOC: set input/output channel error
3679
3680         This symbolic system call is ARCHAIC and OBSOLETE.
3681         It is documented here for historical purposes only.
3682         Its use in new programs is to be avoided.
3683         Its function has been superseded by the JOBIOC
3684         symbolic system call.
3685
3686         arg 1   BOJ channel number or <JOBDEV>
3687         arg 2   IOC error code.
3688
3689         This is used by JOB devices to cause the calling job
3690         to receive a word 1 IOC interrupt.  This interrupt
3691         will be given when the calling job next attempts
3692         an IOT operation.  The .BCHN variable for that job
3693         will be set to the channel it has the JOB device 
3694         pen on, and bits 4.1-4.5 of the corresponding
3695         .IOS word are set to the specified IOC error code.
3696         See also the JOBINT symbolic system call.
3697
3698         Valid IOC error codes are as follows:
3699           1     ILLEGAL HARDWARE OPERATION ATTEMPTED
3700           2     ATTEMPTED RANDOM ACCESS TO ADDRESS BEYOND END OF FILE
3701           3     NON-RECOVERABLE DATA ERROR
3702           4     NON-EXISTENT SUB-DEVICE
3703           5     OVER IOPOP
3704           6     OVER IOPUSH
3705           7     USR OP CHNL DOES NOT HAVE USR OPEN
3706          10     CHNL NOT OPEN
3707          11     DEVICE FULL (can also mean a directory is full)
3708          12     CHNL IN ILLEGAL MODE ON IOT
3709          13     ILLEGAL CHR AFTER CNTRL P ON TTY DISPLAY
3710          14     DIRECTORY FULL
3711          15     DIRECTORY'S ALLOCATION EXHAUSTED
3712
3713 Errors:
3714
3715  33     MEANINGLESS ARGS
3716         Second argument is not a valid IOC error code.
3717  34     WRONG TYPE DEVICE
3718         First argument is not a BOJ channel number.
3719  41     OTHER END OF PIPELINE GONE OR NOT OPEN
3720 \f
3721 SFDATE: set file creation date
3722
3723         arg 1   Disk channel number or <JOBDEV>
3724         arg 2   New creation date and time in disk format:
3725                 4.7-4.1 Year (mod 100.).
3726                 3.9-3.6 Month (January = 1).
3727                 3.5-3.1 Day of month.
3728                 2.9-1.1 Time of creation, in half-seconds
3729                         after midnight.
3730
3731         See also the DSKUPD, FILBLK, RFDATE, RQDATE and SRDATE
3732         symbolic system calls.
3733 \f
3734 SIOT:   byte-string in/out transfer
3735
3736         cbits   Same as for IOT symbolic system call (q.v.).
3737         arg 1   I/O channel number.
3738         arg 2   Byte pointer to string to transfer
3739                 (must not be indexed or indirect).
3740         arg 3   Count of bytes to be transferred.
3741         arg 4   (Optional) device-independent special mode bits.
3742
3743         The second and third arguments are updated as the
3744         transfer proceeds.  If an end of file condition occurs
3745         or the job is interrupted out of the system call, they
3746         may not be fully counted out.
3747
3748         SIOT is notably efficient for STY input and TTY superimage
3749         output - much faster than block mode.  For details of Chaosnet
3750         SIOT, see the description of IOT.
3751
3752         Supposedly some esoteric devices don't support this mode of
3753         I/O transfer, but I can't think of any.  Also, it is alleged
3754         that on some devices, SIOT is not yet as efficient as block
3755         mode.
3756
3757 Errors:
3758
3759  12     MODE NOT AVAILABLE
3760         The device open on this channel doesn't support SIOT.
3761  14     BAD CHANNEL NUMBER
3762  33     MEANINGLESS ARGS
3763         The second or third argument was immediate.
3764 \f
3765 SOPEN: open file, using strings to specify the filename
3766
3767         arg 1   mode bits,,channel number
3768         arg 2   byte pointer to ASCIZ filename string,
3769                  or AOBJN pointer to a block of byte pointers
3770                  to strings to be concatenated.
3771
3772 If the second argument's left half is between -63. and -1, then the
3773 argument is treated as an AOBJN pointer to a block of byte pointers to
3774 ASCIZ strings.  Those ASCIZ strings are effectively concatenated for
3775 parsing.  Otherwise, the second argument is treated as one byte
3776 pointer.  0 may be used as the left half of a byte pointer, and is an
3777 abbreviation for 440700.
3778
3779 The combined string is parsed using the ordinary ITS filename syntax, with
3780 colon indicating a device name, semicolon indicating a directory name, and
3781 space separating filenames.  ^Q is used for quoting colon, semicolon,
3782 space, ^Q and ^@ (which would otherwise terminate the string); it cannot
3783 hurt to quote other characters with ^Q.  SOPEN defaults the device to
3784 "DSK", the second filename to ">", and the directory to the executing job's
3785 current sname.
3786
3787 Multiple devices, directories and names may be significant with some job
3788 devices, and perhaps with disk files as well at some time in the future.
3789
3790 Once the string has been parsed into filenames, operation proceeds as
3791 for the OPEN symbolic system call, which see.
3792
3793 SOPEN appears to a job device handler just like any other OPEN, except
3794 that the original second argument byte or AOBJN pointer is available
3795 as one of the values of the JOBCAL symbolic system call (which see).
3796 For an ordinary OPEN, that value from JOBCAL is zero.
3797 \f
3798 SRDATE: set file reference date
3799
3800         arg 1   Disk channel number or <JOBDEV>
3801         arg 2   New reference date in disk format:
3802                 4.7-4.1 Year (mod 100.).
3803                 3.9-3.6 Month (January = 1).
3804                 3.5-3.1 Day of month.
3805
3806         See also the DSKUPD, FILBLK, RESRDT, and RQDATE
3807         symbolic system calls.
3808 \f
3809 SREAPB: set the do not reap bit
3810
3811         arg 1   Disk channel or <JOBDEV>
3812         arg 2   0 for the normal case.
3813                 1 to request the grim file reaper to
3814                 leave this file alone.
3815
3816         The do not reap bit of the file open on the channel
3817         is set.  The G*** F*** R**P** doesn't
3818         respect this bit yet.
3819
3820         The bit can be read using the FILBLK system call.
3821         It is UNREAP in the FSDEFS insert file.
3822 \f
3823 SSERVE: set server job
3824
3825         arg 1   <JOB>   Client job  (OPTIONAL)
3826                 If omitted, self is assumed.
3827         arg 2   <JOB>   Server job
3828
3829         The .SERVER variable of the client job is modified to point to the
3830         server job.  See the description of .SERVER in .INFO.;ITS USETS.
3831         This system call permits .SERVER to be updated without trafficking
3832         in user indices.
3833
3834 Errors:
3835
3836  34     WRONG TYPE DEVICE
3837         Neither the client nor the server can be the PDP6
3838  31     CAN'T MODIFY JOB
3839         Executing job must be able to modify the client job.
3840 \f
3841 SSTATU: get various system status variables
3842
3843         val 1   If non-negative, the time (in thirtieths of a
3844                 second) until the system will go down.
3845                 -1 if the system does not intend to go down.
3846                 -2 if the system is already down (can happen
3847                 in a job with %OPLIV set).
3848                 Obtained from the ITS variable SHUTDN.
3849                 See the .DIETIME, .SHUTDN, and .REVIVE uuos.
3850         val 2   Non-zero if the system is being debugged.
3851                 This state causes the message
3852                         XX ITS ### BEING DEBUGGED
3853                 to appear on free consoles instead of the
3854                         XX ITS ### IN OPERATION
3855                 message usually seen when the system comes up.
3856                 If negative, the system is officially down;
3857                 ^Z is accepted only from tty 0 (the terminal
3858                 physically next to the PDP-10 console) or from
3859                 the tty whose number is the absolute value of
3860                 the contents of this quantity.  A ^Z is also
3861                 accepted from a tty associated with a STY;
3862                 this is so that STY devices may be debugged!
3863                 It is the responsibility of the STELNT server
3864                 to examine this quantity and keep network users
3865                 from logging in when the system is being debugged.
3866                 Obtained from the ITS variable SYSDBG.
3867         val 3   Number of users on the system.  This is a
3868                 count of logged-in, console-controlled job
3869                 trees in the system.  This variable is
3870                 incremented whenever a user logs in from a
3871                 console, and decremented whenever a console-
3872                 controlled tree is detached, gunned, or logged out.
3873                 This is the ITS variable SUSRS.
3874         val 4   Sum of parity and nxm memory errors during this
3875                 incarnation of the system.  This is the sum of
3876                 the ITS variables PARERR and NXMERR.
3877         val 5   Time the system has been up, in thirtieths of
3878                 a second.  This is the ITS variable TIME.
3879                 See the .RDTIME uuo.
3880         val 6   The left-justified name of the machine, i.e. one of:
3881                         SIXBIT \AI\     ;A.I. Lab KS-10
3882                         SIXBIT \ML\     ;Mathlab KS-10
3883                         SIXBIT \MC\     ;Mail Computer KS-10
3884                         SIXBIT \MD\     ;Mostly Development KS-10
3885                         SIXBIT \MX\     ;Macsyma Consortium KL-10
3886                         SIXBIT \SI\     ;Stacken ITS KS-10
3887                         SIXBIT \PM\     ;PandaMonium KS-10
3888                         SIXBIT \FU\     ;Australian KS-10
3889                         SIXBIT \DM\     ;Dynamic Modeling KA-10 (R.I.P.)
3890                         SIXBIT \MLKA\   ;Mathlab KA-10 (R.I.P.)
3891                         SIXBIT \AIKA\   ;A.I. Lab KA-10 (R.I.P.?)
3892                 This is the name which appears for XX in such
3893                 messages as
3894                         XX ITS ### IN OPERATION
3895                 and which serves as a device name for that
3896                 machine's disks (i.e. the ML device is the
3897                 DSK device of the ML (Mathlab) machine).
3898                 If more ITS machines come into existence,
3899                 naturally more machine names will be invented.
3900         val 7   The system version number, in sixbit.  This is
3901                 the ### in such messages as above.
3902         val 8   The number of free job slots.
3903
3904         DDT uses much of this information to print out its
3905         greeting to you:
3906         If value 2 is non-zero DDT prints out
3907                 ITS BEING DEBUGGED!
3908         If value 1 is non-negative DDT prints out
3909                 XX ITS GOING DOWN IN 1:23
3910         if e.g. ITS were going down in 1 minute, 23 seconds.
3911         (DDT also prints the contents of the file SYS:DOWN MAIL
3912         if that file exists.)
3913         Value 3 is used to print out the number of users as
3914                 23. LUSERS
3915         (if your DDT has not logged in itself, it increments
3916         this value so as to count you also).
3917         Values 4 and 5 are used to compute the number of memory
3918         errors per hour, printed as:
3919                 MEM ERRS .034142/HOUR
3920         The DDT command :SSTATU will print out all
3921         this information.
3922 \f
3923 STATUS: get input/output status word
3924
3925         arg 1   Channel number.
3926         val 1   Status word for specified channel.
3927
3928         This call returns a word describing the state of
3929         the specified channel:
3930         4.9-4.6 Always zero.  See the .IOPUSH and .IOPOP
3931                 uuo's, and the .IOP and .IOS user variables.
3932         4.5-4.1 If non-zero, the number of a non-display
3933                 input/output error (see table below).
3934         3.9-3.7 If non-zero, the number of an interpreted
3935                 display input/output error (see table below).
3936         3.6-3.1 If non-zero, the number of a standard error.
3937                 These are the same as the error codes returned
3938                 by failing .CALL's.
3939         2.9-2.3 Device dependent (see below).
3940         2.2     Buffering capacity empty.
3941         2.1     Buffering capacity full.
3942         1.9-1.7 Mode in which device was opened.
3943                 1.9     0 = ascii, 1 = image.
3944                 1.8     0 = unit, 1 = block.
3945                 1.7     0 = input, 1 = output.
3946         1.6-1.1 ITS internal physical device code.
3947                  0      TTY     Console input.
3948                  1      TTY     Printing console output.
3949                  2      TTY     Display console output.
3950                  3      LPT     Data Products line printer.
3951                  4      VID     Vidisector ???
3952                  5      BAT     ??
3953                  6      PLT     Calcomp plotter.
3954                  7      PTP     Paper tape punch.
3955                 10      IMX     Input multiplexor.
3956                 11      OMX     Output multiplexor.
3957                 12      PTR     Paper tape reader.
3958                 13      DIS     DEC 340 display, ascii output.
3959                 14      IDS     Interpreted 340 display.
3960                 15      MTn     Magnetic tape.
3961                 16      COD     Morse code device.
3962                 17      TAB     Tablet. ???
3963                 21      NUL     Source of zeroes, or output sink.
3964                 22      JOB     Job device.
3965                 23      BOJ     Inverse of JOB.
3966                 24      SPY     Spy on another console.
3967                 25      STY     Pseudo-teletype.
3968                 26      NET     ARPAnet (NCP).
3969                 27      LPT     Vogue line printer (yech!)
3970                 30      STK     Stanford keyboard.
3971                 31      MSP     ?
3972                 32      CHAOS   CHAOS net.
3973                 33      TCP     TCP Internet.
3974                 34      TRAP    Trap "device"
3975                 35      IPQ     Internet IP Queue.
3976                 41      UTn     Microtape (DECtape).
3977                 43      DSK     2311 disk drives or equivalent.
3978                 60      USR     A not immediately inferior procedure.
3979                 61      USR     An immediately inferior procedure.
3980                 62      CLx     Various core link devices (CLA, CLI, CLO, CLU)
3981                 63      ---     File directory or ERR device.
3982                 64      USR     The PDP-6.
3983                 65      DIRHNG  Directory hang "device"
3984
3985         Device dependent bits for TTY input:
3986         2.9     Local tty.
3987         2.8     Next to the 340 or a 340 slave.
3988         2.5     Chars pending which have been .ITYIC'ed but not IOT'ed.
3989         2.4     The job possesses the tty.
3990
3991         Device dependent bits for TTY output:
3992         2.4     The job possesses the tty.
3993
3994         Device dependent bits for Data Products LPT:
3995         2.9-2.3 Current column (left margin = 0).
3996
3997         Device dependent bits for MTn (macro-tape):
3998         2.9     Chunk, write EOR after each IOT (should be block) on output,
3999                         don't ignore them on input.   See magtap info.
4000         2.8     0 => odd parity, 1 => even parity.
4001         2.7-2.6 Density: 00 => 800, 01 => 200, 10 => 556.
4002                 Apparently 11 => IBM 9 track 800 bpi??
4003         2.5     0 => 7 track, 1 => 9 track.
4004         2.4     End of tape.
4005         2.3     Read compare error.
4006
4007         Device dependent bits for NET:
4008         2.9-2.4 Socket state:
4009                 0       %NSCLS  CLS received or net down.  Connection closed.
4010                 1       %NSLSN  Listening for RFC.
4011                 2       %NSRFC  RFC received while listening.
4012                 3       %NSRCL  CLS received while in state 2.
4013                 4       %NSRFS  RFC sent.
4014                 5       %NSOPN  Connection open.
4015                 6       %NSRFN  RFNM wait on write link.
4016                 7       %NSCLW  CLS sent; waiting for matching CLS.
4017                 10      %NSCLI  CLS received but input still available.
4018                 11      %NSINP  Input available.
4019
4020         Device dependent bits for TCP:
4021         2.9-2.4 Connection state - see WHYINT call for state codes.
4022
4023         CHAOSnet provides no device dependent bits.
4024
4025         A STATUS word can be supplied to the ERR
4026         device to obtain corresponding error message, if any.
4027
4028         See also the JOBSTS symbolic system call, the .STATUS uuo,
4029         and the .IOS user variable.
4030 \f
4031 STDMST: set demon status
4032
4033         arg 1   Either the sixbit name or the user index
4034                 of a demon job.
4035         arg 2   If negative, flush all requests for the specified demon.
4036                 Otherwise:
4037                 4.9-3.1 If non-zero, the time in two-minute ticks
4038                         between automatic signals for the demon.
4039                 2.9-1.1 Number of requests pending for the demon.
4040         arg 3   Time in two-minute ticks until the next automatic
4041                 signal will occur (meaningful only if arg 2 bits
4042                 4.9-3.1 not zero).
4043
4044         See also the DEMSIG and RDDMST symbolic system calls,
4045         and the .DEMON uuo.
4046 \f
4047 STLGET: get information from Server Telnet
4048
4049         arg 1   a <TTY>
4050
4051         val 1   XJNAME of server telnet
4052         val 2   TRMNAM of server telnet
4053                 This is the sixbit name of the host connected to.
4054         val 3   SNAME of server telnet
4055         val 4   In LH: STY status bits
4056                 In RH: index of telnet server job which owns the STY.
4057
4058         This call can be used to find out where in the network
4059         a TTY really is.
4060
4061         The STY status bits are from the STYSTS table in ITS.
4062         Some of the more interesting ones include:
4063         %SSNET==4000    ;4.3 = 1 => THIS STY CONNECTED TO SOME NET SOCKETS.
4064         %SSCHA==2000    ;4.2 = 0 FOR ARPANET, 1 FOR CHAOS NET
4065         %SSTCP==1000    ;4.1 = 1 for TCP internet (%SSCHA must be 0)
4066
4067 Errors:
4068
4069 34      WRONG TYPE DEVICE
4070         Specified TTY is not controlled by a server telnet.
4071 \f
4072 STYGET: get information about STY
4073
4074         arg 1   <TTY>  (need not be associated with a STY)
4075         val 1   STY status word:
4076                 4.9     %SSHNG  Don't hang on input IOT.
4077                 4.8     %SSUSE  STY is in use.
4078                 4.7     %SSINT  Have given interrupt on STY output channels.
4079                 4.6     %SSONT  Have given interrupt on STY input channels.
4080                 4.5     %SSOHG  Don't hang on output IOT.
4081                 4.4     %SSORS  Give a %TDORS whenever an output RESET is
4082                                 done on the controlled tty, regardless
4083                                 of whether the tty is a software tty.
4084                 2.9-1.1 User index of job which owns the STY.
4085                 Zero if STY is not in use, or if TTY is not
4086                 associated with a STY.
4087         val 2   User index of job which owns the TTY, either as a device
4088                 or as a currently possessed console; or -1 if TTY is free.
4089         val 3   -1 if the TTY is not a console or is free.  Otherwise,
4090                 2.9-1.1 is the user index of the top-level job of the
4091                 job tree controlled by the TTY.
4092                 4.8 = 1 if that job is in the process of logging out.
4093                 4.7 = 1 if that job is logged in.
4094
4095         val 4   4.9     Owner of TTY is in a TTY output wait on the TTY.
4096                 1.1     Owner of TTY is in a TTY input wait on the TTY.
4097                 These bits probably don't work very well.
4098         val 5   4.9     TTY input available.
4099                 4.8     TTY output buffer has room.
4100         val 6   The tty's TTYSTA word.
4101                 4.9     %TACFM  TTY does not need a console free message
4102                                 eventually (hasn't been in use since
4103                                 the last one).
4104                 4.8     %TAC.Z  TTY is being ^Z'd.  Shouldn't be on with
4105                                 %TACFM.  If %TACFM and %TAC.Z are both 0,
4106                                 the tty is being freed and a console free
4107                                 message is immanent.
4108                 4.7     %TANJS  This ^Z is being flushed because no job
4109                                 slots are available.  If set, %TAC.Z
4110                                 will be 1 and %TACFM will be 0.
4111
4112         This symbolic system call originally was intended to return
4113         STY information, but now returns useful data concerning any TTY.
4114 \f
4115 STYNET: Connect a STY to a pair of Network connections.
4116
4117         arg 1   Sty channel (either direction).
4118         arg 2   -1 to disconnect the STY from its network channels
4119                 (in which case args 3 and 4 are unnecessary),
4120                 or Net input channel (to connect STY output to).
4121                 This may be a NCP, TCP, or CHAOS channel.
4122         arg 3   Net output channel (to connect STY input to).
4123         arg 4   Characters to send out on net
4124                 when an output .RESET is done on the STY's TTY.
4125                 Up to 3 8-bit characters, left-justified.
4126
4127         It is possible with this call to connect a STY to a pair
4128         of network channels, one open for input, and one open for output.
4129         When the direct connection is established, anything received by
4130         the net input socket will be fed automatically to the
4131         STY, and any type-out that the STY receives from its TTY will be
4132         fed automatically to the net output channel.  The transfer of
4133         data is handled by the system at clock level, eliminating
4134         the need for the program to wake up at each character.
4135
4136         Only one input and one output net channel can be connected to
4137         a STY, and only one STY can be connected to any net channel.
4138         Both sides of a STY are connected and disconnected at once.
4139         A job can connect a STY if it has the STY open in either direction
4140         (but it will generally want to have both directions open).
4141
4142         Once established, the direct connection will last until
4143         broken explicitly by the user, or until an escape condition
4144         is detected by the system.  Escape conditions include receipt
4145         of a TELNET control character on the net input channel (any
4146         character with the 200's bit on), and
4147         either net channel's getting into an abnormal state (other
4148         than %NSOPN, %NSINP, or %NSCLI) - in general, things which
4149         the system expects that the user program will want to take
4150         action on.  
4151
4152         The connection can be broken explicitly by the user either
4153         by a STYNET call with arg 2 negative, or by a CLOSE of any
4154         of the channels involved (this also happens when the job 
4155         is killed.)  It is an error to IOT on any of the channels
4156         without breaking the connection first.
4157
4158         The STYNET call returns immediately, without actually
4159         transferring any data.  The program can assume that the
4160         connection is still in effect until it is notified of
4161         a disconnection by an interrupt on the net input channel.
4162         While the connection lasts, interrupts on the net channels
4163         due to arriving data are intercepted by the system, so
4164         an interrupt implies that the connection has been broken.
4165
4166         When a %TDORS comes out of the STY, indicating that the TTY's
4167         output buffer has been cleared, this is indicated to the net
4168         output channel by means of a network interrupt (NCP only), and the
4169         string of up to 3 characters specified as the fourth argument
4170         to the STYNET call.  If TCP, these characters are PUSHed with the
4171         URGENT bit set.
4172
4173         If you use STYNET with the official TELNET protocol, you must
4174         turn on the %TPTEL bit in the STY TTY's TTYOPT variable, to
4175         cause the sequence CR-LF to be turned into just a CR.
4176
4177         For the Chaosnet:
4178         arg 1 - STY channel
4179         arg 2 - Chaos channel to connect to, or
4180                 -1 to disconnect
4181         arg 3 - Other Chaos channel (not actually used)
4182         arg 4 - Output-reset character sequence, up to 3 8-bit
4183                 characters left-justified.
4184
4185         This works the same as on the Arpanet.  The specified STY
4186         is connected to or disconnected from a Chaos net channel.
4187         Data is transferred in and out by the system without the
4188         need for intervention by the user program.  If an unusual
4189         condition occurs, the STY is disconnected from the Chaos
4190         channel and the user is interrupted.  It is illegal to do
4191         I/O on any of the involved channels while they are connected.
4192
4193         This call is provided for the benefit of the "Telnet" server.
4194
4195 Errors:
4196
4197  2      WRONG DIRECTION
4198         An input net channel was supplied as the third argument, or
4199         an output channel was supplied as the second argument.
4200  23     FILE LOCKED
4201         The STY or one of the network channels is already direct-connected
4202         to another network channel or another STY.
4203  41     OTHER END OF PIPELINE GONE OR NOT OPEN
4204         An attempt was made to disconnect a STY not already connected.
4205 \f
4206 T11MP:  PDP-10 to PDP-11 map
4207
4208         arg 1   Page number within the user's core.  That page
4209                 must be either non-existent or shared with an
4210                 absolute page.  The user's virtual page is made
4211                 to share with some arbitrarily chosen absolute
4212                 page, which is then made to share with PDP-11 memory
4213                 according to argument 2.
4214         arg 2   Desired PDP-10 to PDP-11 map word.
4215                 4.9     Valid (must be 1).
4216                 4.8     Write enable.
4217                 4.7-4.3 Unused.
4218                 4.2-3.9 PDP-11 number.  See below.
4219                 3.8-2.2 Relocation (origin of segment in PDP-11
4220                         address space).  <PDP-11 address> = 4*<relocation>.
4221                 2.1-1.1 Protection (number of accessible words - 1).
4222                         <PDP-11 protection> = 4*<protection>.
4223                         If protection=0 then only one 16-bit word
4224                         is accessible.
4225
4226         The CORBLK symbolic system call may be used in the special
4227         case of mapping one's TV console video buffer memory.
4228
4229         The AI KA-10 has a PDP-10 to PDP-11 interface which lets the PDP-10
4230         programmer directly access the memories of up to eight PDP-11's.
4231         PDP-10 pages are mapped into segments of variable size in the
4232         PDP-11's memory.  The PDP-10 to PDP-11 page map is also directly
4233         addressable in memory (it currently lives in absolute locations
4234         2,,776000 - 2,,776377).  There are 256. such entries, one for each
4235         page in the range 2,,0 - 2,,777777, which are the addresses fielded
4236         by the PDP-10 to PDP-11 interface.  ITS allocates these pages
4237         and their corresponding map entries randomly as needed.
4238
4239         When the PDP-10 attempts to access a physical address in the range
4240         2,,0 to 2,,777777, the interface uses the 776000 bits to index
4241         the map words.  If the appropriate map word does not have its
4242         valid bit set, the memory is considered non-existent.  The same
4243         is true if the reference would violate the protection bounds.
4244         The reference also fails if it is a write reference and the
4245         map word does not have the write enable bit set.
4246         Otherwise, the relocation quantity is added to the 1777 bits,
4247         and this determines which PDP-11 double-word to access.
4248         The PDP-11 number determines which PDP-11 to access, of course.
4249         The PDP-11 double-word corresponds to the high 32. bits of the
4250         PDP-10 word, as follows:
4251         PDP-10 BIT      PDP-11 WORD AND BIT
4252         4.9             0       15
4253         4.8             0       14
4254         4.7             0       13
4255         ---             ---     ---
4256         3.4             0       01
4257         3.3             0       00
4258         3.2             1       15
4259         3.1             1       14
4260         ---             ---     ---
4261         1.6             1       01
4262         1.5             1       00
4263         When reading the PDP-11 memory, bits 1.4-1.1 are read as zeros.
4264         When writing, 1.4=1 means don't change word 0, 1.3=1 means don't
4265         change word 1, and 1.2-1.1 are ignored.  Split cycles do the right
4266         thing, so ILDB and IDPB should work correctly.
4267         Note that accessing consecutive 16.-bit PDP-10 bytes will access
4268         consecutive PDP-11 words, but accessing consecutive 8-bit PDP-10
4269         bytes will not access consecutive PDP-11 bytes!  Rather, the PDP-11
4270         bytes are accessed in the order 1, 0, 3, 2.
4271
4272         The following PDP11s are currently (4/2/76) attached.
4273
4274                 0       The pdp11 that runs the AI KA-10 TV system.
4275                 1       The pdp11 that runs the AI KA-10 XGP.
4276                 2       The Lisp Machine GT40.
4277                 3       The Chess Machine (not really a pdp11.)
4278                 4       The Logo pdp11/45.
4279                 5       The Micro-Automation pdp11/45.
4280
4281 Errors:
4282
4283   1     NO SUCH DEVICE
4284         There is no PDP-11 connected to this PDP-10.
4285   3     DEVICE NOT READY
4286         The PDP-11 is not ready.
4287  33     MEANINGLESS ARGS
4288         The page number is invalid, or the map word has bit 4.9=0.
4289  37     NO CORE AVAILABLE
4290         No map words free.
4291 \f
4292 TCPOPN: open a TCP Internet connection          (TCP;TCPDOC >)
4293
4294         arg 1 - receive channel number
4295         arg 2 - transmit channel number
4296         arg 3 - local port #    (-1 to gensym a unique local port #)
4297         arg 4 - foreign port #  (-1 for wild port)
4298         arg 5 - foreign host address (HOSTS3 fmt) (-1 for wild host)
4299         arg 6 - Retransmission timeout (optional, not yet used)
4300
4301 Control bits:
4302         - None needed for channels - they are opened as .UAI and .UAO
4303                 automatically (no other modes possible).
4304         - 7 vs 8 bit ASCII transfers can be determined by user-space byte
4305                 pointer used in SIOT.  System buffers are always 8-bit bytes.
4306         %NOLSN - Listen mode
4307
4308         Note a value of -1 for either the foreign port or host will imply
4309         that the call is a "listen".  Return is always immediate, use NETBLK
4310         to determine when the channels become open.  For a non-listen call,
4311         there is an internal ITS timeout, but for listen the state can persist
4312         forever.
4313
4314 ERRORS:
4315   6     - No free TCBs or buffers available (system has too many active conns)
4316   7     - TCP disabled in system.
4317  11     - Bad local or fgn port #
4318  13     - Connection already exists with these ports
4319  14     - Bad channel # arguments.
4320  33     - Illegal to use same channel for both input/output.
4321 \f
4322 TRANAD: add a translation entry                                 (ITS TRANSL)
4323
4324         cbits   2.9     Atomic translation (do not retranslate).
4325                 2.8     0 => TRNLST, 1 => TRNLS1.
4326                         The TRNLST applies only to the specified job;
4327                         the TRNLS1 applies to the job and its inferiors,
4328                         direct or indirect.
4329                 1.2     Output translation.
4330                 1.1     Input translation.
4331                 Before the control bits are interpreted, the LH
4332                 of arg 1 is XOR'd into them.
4333         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4334         arg 2   AOBJN pointer to a block of "from" names.
4335         arg 3   AOBJN pointer to a block of "new" names.
4336
4337         Each AOBJN pointer should point to a block of
4338         from one to four words.  These are, in order, the
4339         device, file name 1, file name 2, and sname which
4340         are to be translated.  All names are left-justified
4341         within a word.  A zero or omitted word is equivalent
4342         to *.
4343         Before creating the translation, a TRANDL is
4344         performed on the first two arguments to prevent
4345         duplicate translations.
4346
4347         Uuos and symbolic system calls affected by translation
4348         include .FDELE, .OPEN, MLINK, RENAME, and OPEN.
4349
4350 Errors:
4351
4352   5     DIRECTORY FULL
4353         No room in system for new translation entry.
4354  14     BAD CHANNEL NUMBER
4355  31     CAN'T MODIFY JOB
4356  33     MEANINGLESS ARGS
4357  34     WRONG TYPE DEVICE
4358         Not meaningful to put a translation on the PDP-6.
4359  35     NO SUCH JOB
4360 \f
4361 TRANCL: clear translation list  (delete all entries)            (ITS TRANSL)
4362
4363         cbits   2.8     Clear TRNLS1.
4364                 2.7     Clear TRNLST.
4365                 The TRNLST applies only to the
4366                 specified job;  the TRNLS1 applies
4367                 to the job and its inferiors,
4368                 direct or indirect.
4369                 Before the control bits are interpreted, the LH
4370                 of arg 1 is XOR'd into them.
4371         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4372
4373
4374         Either or both lists may be cleared with a single call.
4375 Errors:
4376
4377  14     BAD CHANNEL NUMBER
4378  31     CAN'T MODIFY JOB
4379  33     MEANINGLESS ARGS
4380  34     WRONG TYPE DEVICE
4381         Not meaningful to clear translation lists for PDP-6.
4382  35     NO SUCH JOB
4383 \f
4384 TRANDL: delete a translation entry                              (ITS TRANSL)
4385
4386         cbits   2.8     0 means TRNLST, 1 means TRNLS1.
4387                         The TRNLST applies only to the
4388                         specified job;  the TRNLS1 applies
4389                         to the job and its inferiors,
4390                         direct or indirect.
4391                 1.2     Stop translating for output.
4392                 1.1     Stop translating for input.
4393                 Before the control bits are interpreted, the LH
4394                 of arg 1 is XOR'd into them.
4395         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4396         arg 2   An AOBJN pointer to a block of names.
4397
4398         The AOBJN pointer should point to a block of
4399         from one to four words.  These are, in order, the
4400         device, file name 1, file name 2, and sname which
4401         are no longer to be translated.  All names are
4402         left-justified within a word.  A zero or omitted
4403         word is equivalent to *.
4404
4405 Errors:
4406
4407   4     FILE NOT FOUND
4408         No such translation entry to delete.
4409  14     BAD CHANNEL NUMBER
4410  31     CAN'T MODIFY JOB
4411  33     MEANINGLESS ARGS
4412  34     WRONG TYPE DEVICE
4413         Not meaningful to delete translation entry for PDP-6.
4414  35     NO SUCH JOB
4415 \f
4416 TRANEX: examine a translation list                              (ITS TRANSL)
4417
4418         cbits   2.8     0 means TRNLST, 1 means TRNLS1.
4419                         The TRNLST applies only to the
4420                         specified job;  the TRNLS1 applies
4421                         to the job and its inferiors,
4422                         direct or indirect.
4423                 Before the control bits are interpreted, the LH
4424                 of arg 1 is XOR'd into them.
4425         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4426         arg 2   AOBJN pointer to array in core.
4427         val 1   AOBJN pointer to tail end of array,
4428                 i.e. the part not needed to hold the data.
4429
4430         The translation list is stored as consecutive
4431         nine-word blocks of translation information.
4432         Each block has the following form:
4433                 wd 0    4.9     Atomic translation entry.
4434                         3.2     Output translation.
4435                         3.1     Input translation.
4436                 wd 1    "from" device name.
4437                 wd 2    "from" file name 1.
4438                 wd 3    "from" file name 2.
4439                 wd 4    "from" sname.
4440                 wd 5    "to" device name.
4441                 wd 6    "to" file name 1.
4442                 wd 7    "to" file name 2.
4443                 wd 8    "to" sname.
4444         A zero word for a "from" name means translate for any
4445         name in that position; a zero "to" word means don't
4446         change that name when translating.
4447
4448 Errors:
4449
4450  14     BAD CHANNEL NUMBER
4451  33     MEANINGLESS ARGS
4452  34     WRONG TYPE DEVICE
4453         Not meaningful to examine translation list for PDP-6.
4454  35     NO SUCH JOB
4455  37     NO CORE AVAILABLE
4456         Supplied array too small to hold data.
4457 \f
4458 TRANS:  translate some file names                               (ITS TRANSL)
4459
4460         cbits   1.1     0 for input, 1 for output.
4461         arg 1   "from" device name.
4462         arg 2   "from" file name 1 (defaults to zero).
4463         arg 3   "from" file name 2 (defaults to zero).
4464         arg 4   "from" sname (defaults to job's current sname).
4465         arg 5   mode (XOR'd with control bits; defaults to 0).
4466         val 1   "to" device name.
4467         val 2   "to" file name 1.
4468         val 3   "to" file name 2.
4469         val 4   "to" sname.
4470
4471         The given file names are translated by the same rules
4472         for translation governing the operations of OPEN,
4473         RENAME, DELETE, and MLINK.  These rules are as follows.
4474
4475         Translation lists are searched in the order:
4476                 executing job's TRNLST
4477                 executing job's TRNLS1
4478                 executing job's superior's TRNLS1
4479                 that job's superior's TRNLS1
4480                 . . .
4481                 top-level job's TRNLS1
4482                 system job's TRNLS1
4483         The lists are searched for an entry matching the given "from"
4484         file names.  A translation entry is said to match if each
4485         "from" name matches the entry's corresponding name,
4486         and if the translation entry applies to the mode (input or output).
4487         A name in turn matches if the entry's name is the same as
4488         the given name, or if the entry's name is * (matches anything).
4489         If a match is found, the given file names are replaced by the "to"
4490         file names in the translation entry, except that in the entry
4491         a "to" file name of * means don't change the given name;
4492         the process is then repeated from the beginning unless the
4493         matching translation entry is atomic.  When this happens, or
4494         when a full search finds no matching translation entries,
4495         the translation process is complete.  To prevent endless
4496         retranslation, it is considered an error to repeat the
4497         translation process more than eight times.
4498
4499         When a job is first created its TRNLST and TRNLS1 are null.
4500         The TRANAD, TRANCL, TRANDL, and TRANEX symbolic system calls
4501         may be used to examine and modify translation lists.
4502
4503 Errors:
4504
4505   3     TOO MANY TRANSLATIONS
4506         No more than eight consecutive translations are permitted.
4507 \f
4508 TRPOPN: Open trap-device channel
4509
4510         arg 1   <JOB>
4511         arg 2   channel number in that job
4512         arg 3   IOCHNM word (only LH is used)
4513         arg 4   IOCHST word
4514
4515         The specified channel of the specified job is made a trap-device
4516         channel.  Almost any attempt to use it will cause a %PITRP interrupt.
4517         See documentation of the TRAP: device.
4518
4519 Errors:
4520
4521 13      FILE ALREADY EXISTS
4522         The specified channel is open.
4523
4524 14      BAD CHANNEL NUMBER
4525         arg 2 is invalid.
4526
4527 31      CAN'T MODIFY JOB
4528         The <JOB> is not clobberable.
4529
4530 34      WRONG TYPE DEVICE
4531         The <JOB> is the pdp-6.
4532 \f
4533 TTYESC: simulate type-in of ^_
4534
4535         arg 1   <TTY>
4536
4537         Pretends that the user has just typed in a ^_.
4538         The next character the user types will be interpreted
4539         as a ^_ command.
4540
4541         The intended use of this is for programs which use
4542         super-image input, so that ^_ does not have its normal
4543         effect, but which wish to provide an escape convention
4544         so that the effect of ^_ can be obtained.  When the program
4545         sees the escape character sequence as input, it should
4546         do a TTYESC.
4547
4548 Errors:
4549
4550 7       DEVICE NOT READY
4551         The terminal is already in the middle of a ^_ code
4552         being typed by the user.
4553 \f
4554 TTYFLS: flush TTY input
4555
4556         arg 1   <TTY>
4557         control bits:
4558         1.1     0 => cause the last interrupt character .ITYIC'ed
4559                      to be ignored by .IOT.
4560                 1 => discard all input up to and including the last
4561                      character .ITYIC'ed.
4562
4563         This call is normally used by TTY input interrupt handlers.
4564 \f
4565 TTYGET: read the variables TTYST1, TTYST2, TTYSTS               (ITS TTY)
4566
4567         arg 1   <TTY> or <JOBDEV>
4568         val 1   TTYST1 variable.
4569                 This variable contains six groups of six bits.
4570                 Each group is as follows:
4571                 1.6     %TGMPE  Echo at main program level (when IOT'ed).
4572                 1.5     %TGPIE  Echo at interrupt level (when typed).
4573                 1.4     %TGIMG  Echo in image mode.
4574                 1.3     %TGSPC  Special hack: convert lower case to upper.
4575                 1.2     %TGACT  Activation character.
4576                 1.1     %TGINT  Interrupt character.
4577                 The character groups are:
4578                 4.9-4.4         ^@-^F ^K ^L ^N-^R ^T-^Z ^\-^_
4579                 4.3-3.7         Upper and lower case letters.
4580                 3.6-3.1         Digits.
4581                 2.9-2.4         ! " # $ % & ' , . : ; ? @ \ ` | ~
4582                 2.3-1.7         + * - / = ^ _
4583                 1.6-1.1         < > ( ) [ ] { }
4584         val 2   TTYST2 variable.
4585                 Six more groups of six bits:
4586                 4.9-4.4         ^G ^S
4587                 4.3-3.7         ^I ^J  (tab, linefeed)
4588                 3.6-3.1         altmode  (33)
4589                 2.9-2.4         ^M  (carriage return)
4590                 2.3-1.7         rubout  (177)
4591                 1.6-1.1         space, ^H  (backspace)
4592         val 3   TTYSTS variable.
4593                 4.9     %TSFRE  Free console (not in use).
4594                 4.8     %TSCLE  ^L should echo as "^L" (normally
4595                                 clears screen on displays).
4596                 4.7     %TSHDX  Same as %TOHDX.  Vestigial.
4597                 4.6     %TSFCO  Use full 12-bit TV char set for output and
4598                                 echoing: echo CONTROL as ALPHA, echo META
4599                                 as BETA, echo SUPER as EPSILON, and use
4600                                 Sail graphics if TOP is set.
4601                 4.5     %TSALT  Do not standardize altmodes.
4602                 4.4     %TSROL  Scroll mode.
4603                 4.3     %TSSAI  Echo and ascii output use SAIL
4604                                 character set.
4605                 4.2     %TSACT  Next input IOT shouldn't wait
4606                                 for an activation character.
4607                 4.1     %TSNEA  Don't echo in echo area; echo in M.P. Area.
4608                 3.9     %TSINT  Next input character should
4609                                 interrupt even if it ordinarily
4610                                 would not (%TGINT = 0).
4611                 3.8     %TSMOR  Inhibit **MORE** processing.
4612                 3.7     %TSATY  Set whenever an .ATTY executed by
4613                                 some superior returns the tty to
4614                                 the job.
4615                 3.4     %TSNOE  Defer echoing.
4616                 3.3     %TSLCZ  Last character typed was ^Z.
4617                                 This bit causes .ATTY's to fail.
4618                 3.2     %TSSII  Super-image input.  The special
4619                                 actions of ^Z and ^_ are suppressed.
4620                 3.1     %TSCNS  This is a console, not a device.
4621                 2.9-1.1 The user index of the job which controls
4622                         the tty, or -1 if the tty is free.
4623         val 4   the TTYTYP variable
4624                 See the CNSGET documentation.
4625         val 5   the TCTYP variable
4626                 See the CNSGET documentation.
4627
4628         Values 4 and 5 probably should not be depended upon.
4629
4630         See also the CNSGET, CNSSET, and TTYSET symbolic system calls.
4631
4632 Errors:
4633
4634   1     NO SUCH DEVICE
4635         No tty exists with the specified number.
4636  14     BAD CHANNEL NUMBER
4637  34     WRONG TYPE DEVICE
4638 \f
4639 TTYSET: set the variables TTYST1, TTYST2, TTYSTS                (ITS TTY)
4640
4641         arg 1   <TTY> or <JOBDEV>
4642         arg 2   TTYST1 variable.  See under TTYGET.
4643         arg 3   TTYST2 variable.  See under TTYGET.
4644         arg 4   TTYSTS variable (optional).  See under TTYGET.
4645                 %TSFRE, %TSHDX, %TSLCZ, and %TSCNS may not be altered,
4646                 nor may the RH.
4647
4648         See also the CNSGET, CNSSET, and TTYGET symbolic system calls.
4649
4650 Errors:
4651
4652   1     NO SUCH DEVICE
4653         No tty exists with the specified number.
4654  14     BAD CHANNEL NUMBER
4655  34     WRONG TYPE DEVICE
4656 \f
4657 TTYVAR: read or set a variable associated with a TTY.
4658
4659         arg 1   <TTY> or <JOBDEV>
4660
4661         In the simplest mode:
4662
4663         arg 2   the name of a tty variable, in SIXBIT.
4664         arg 3   (if writing) the new value.
4665
4666         If arg 3 is not supplied, you are reading, and
4667         val 1   is the value of the variable.
4668
4669         In immediate-instruction mode:
4670
4671         arg 2   the SIXBIT name of a tty variable.
4672         arg 3   ignored
4673         arg 4   the instruction
4674
4675         This mode is detected by the presence of four arguments.
4676
4677         The specified instruction is executed as if the
4678         variable was in ac 0.  MOVE can be used to set the
4679         variable, MOVEM to read it, but you can also use
4680         TLO to set bits, ADDI to increment, etc.
4681
4682         In block mode
4683
4684         arg 2   an AOBJN pointer to a block of pairs of words.
4685
4686         This mode is detected by bits 4.1-4.9 of arg 2 being all
4687         ones.
4688
4689         The first word in each pair is the SIXBIT name of a tty
4690         variable, and the second word is an instruction to be
4691         executed as if that variable were in ac 0.  The block pointer
4692         argument is updated.
4693
4694         The TTY variables include HEIGHT, WIDTH, ISPEED, OSPEED, TTYOPT,
4695         TTYTYP, TTYCOM, TCTYP, TTYROL, TTYSMT, and IDLTIM.  See
4696         .INFO.;ITS TTY for a description of their meanings.
4697
4698         The instructions allowed in immediate-instruction and
4699         block modes are:  MOVx, MOVxI, MOVEM, ADD, ADDI, SUB, SUBI,
4700         all Booleans in normal and immediate modes, and TxZ, TxC,
4701         and TxO (i.e. all Test instructions that modify and don't
4702         skip.)
4703
4704 Errors:
4705
4706  11     ILLEGAL FILE NAME
4707         Unrecognized tty variable name.
4708  26     DEVICE WRITE-LOCKED
4709         Specified variable or specified tty cannot be written.
4710  33     MEANINGLESS ARGS
4711         Attempt to store an illegal value in the TCTYP variable,
4712         or an illegal instruction was specified in immediate-
4713         instruction or block mode.
4714 \f
4715 TVWHER: tell where a TV is
4716
4717         arg 1   <TTY> or <JOBDEV>
4718         val 1   The keyboard number of the physical
4719                 terminal in use.
4720                 The correspondence between keyboard numbers
4721                 and physical locations is in the file
4722                 SYSENG;TVKBD ROOMS, which is how the NAME
4723                 program gets this information.  If this table
4724                 and that file disagree, that file is correct,
4725                 and please update this table.
4726                 As of February 7, 1977, these correspondences
4727                 were in effect:
4728                 KBD #   ROOM    WHO LIVES THERE
4729                 0       809     Fahlman, Holloway, Knight x7807
4730                 1       810     Lavin, Kuipers, Miller, Bruss x7836 
4731                 2       919     Very Small Data Bases north x6765 
4732                 3       812     Yvonne, Karen x5876 
4733                 4       813     Hewitt x5873 
4734                 5       814     Sussman, McDermott x5874 
4735                 6       808     Freiling, Lozano-Perez, Ullman x5875 
4736                 10      817     Jabari x6218 
4737                 13      819     Goldstein x5879 
4738                 14      820     Minsky x5864 
4739                 17      822     Marr x2082 
4740                 21      824     Rich, Levin, DeKleer x6032 
4741                 22      825     Purcell, Doyle x5848 
4742                 23      826     Fredkin's Folly x5904
4743                 30      925     Moon (Tycho, north wall) x6765 
4744                 31      902     Mason, Raibert, Hollerbach x3483 
4745                 32      919     Very Small Data Bases south x6765 
4746                 33      344     Edwards, Lebel x6765 
4747                 34      913     Baisley, Greenblatt x6765 
4748                 35      914     Gosper's Fishbowl x2076 
4749                 36      912     9th Floor Lounge x6765 
4750                 37      907     Chess, Lisp Machines x6765 
4751
4752         val 2   The number of the TV video buffer in use
4753                 on this tty (0-17 octal).  This is NOT a
4754                 Video Switch input number.
4755
4756 Errors:
4757
4758   1     NO SUCH DEVICE
4759         No tty exists with the specified number.
4760  10     DEVICE NOT AVAILABLE
4761         The PDP-11 which services the TV consoles is down.
4762  34     WRONG TYPE DEVICE
4763         The specified tty was not a TV, or the specified
4764         channel was not a <TTY> or <JOBDEV>.
4765 \f
4766 UNLOCK: Unlock JOB's locks.
4767
4768         arg 1   <JOB>
4769
4770         If the specified job is writable, and is using the locks
4771         feature, its locks are unlocked.  (Usually this is used on
4772         onesself.)  See the ITS LOCKS file for more information
4773         on locks.
4774
4775 Errors:
4776
4777  31     CAN'T MODIFY JOB
4778         The specified job is not writable.
4779
4780  Plus the usual errors for <JOB> arguments.
4781 \f
4782 USRMEM: Read or write another job's memory
4783
4784         cbits   2.9     Allow writing into any job
4785                 1.1     If page isn't readable or writable give an
4786                         MPV or pure interrupt to the job being
4787                         referenced.
4788
4789         arg 1   <JOB>
4790         Other args are like USRVAR and TTYVAR.  In place of
4791         a variable-specifier you put the address in the job
4792         of the word to be read or written.
4793
4794         arg 2   Address to read or write (non-negative)
4795
4796         Straight reading:
4797
4798         Specify only 2 arguments.
4799
4800         Straight writing:
4801
4802         arg 3   New value
4803
4804         Writing with an instruction:
4805
4806         arg 3   Ignored
4807         arg 4   Instruction to write with
4808
4809         Block mode:
4810
4811         arg 2   An AOBJN pointer to a block of pairs, first address
4812                 and then instruction.
4813
4814         val 1   Previous contents (these are not valid in block mode)
4815         val 2   New contents
4816
4817
4818         Reading:
4819                 The content of the specified address in <JOB>
4820                 is returned as val 1.
4821
4822         Writing:
4823                 Arg 3 is written into the specified address
4824                 in <JOB>.  The previous contents are returned
4825                 as val 1.
4826
4827         Writing with an instruction:
4828                 The instruction should modify its AC as if the spec'd job's
4829                 memory location were in it.  The memory operand is fetched
4830                 from your own address space and is not stored back.
4831                 No jobs can run while the location is being modified, that is
4832                 between the fetching of the old value and the storing of
4833                 the new value.
4834                 The previous contents are returned as val 1, the new
4835                 contents as val 2.
4836
4837 Errors:
4838
4839  31     CAN'T MODIFY JOB
4840         The specified job is not writable.
4841  32     CAN'T GET THAT ACCESS TO PAGE
4842         The specified page is either nonexistant
4843         or is read-only.
4844  33     MEANINGLESS ARGS
4845         Attempt to specify an illegal instruction for writing.
4846 \f
4847 USRVAR: Read or set some of a job's variables
4848
4849         arg 1   <JOB>
4850
4851         In the simplest mode:
4852
4853         arg 2   user variable specifier (see below).
4854         arg 3   (if writing) the new value.
4855
4856         If arg 3 is not supplied, you are reading, and
4857         val 1   is the value of the variable.
4858
4859         In immediate-instruction mode:
4860
4861         arg 2   user variable specifier (see below).
4862         arg 3   ignored
4863         arg 4   the instruction
4864
4865         This mode is detected by the presence of four arguments.
4866
4867         The specified instruction is executed as if the
4868         variable was in ac 0.  MOVE can be used to set the
4869         variable, MOVEM to read it, but you can also use
4870         TLO to set bits, ADDI to increment, etc.
4871
4872         In block mode
4873
4874         arg 2   an AOBJN pointer to a block of pairs of words.
4875
4876         This mode is detected by bits 4.1-4.9 of arg 2 being all
4877         ones.
4878
4879         The first word in each pair is the user variable specifier
4880         (see below), and the second word is an instruction to be
4881         executed as if that variable were in ac 0.  The block pointer
4882         argument is updated.
4883
4884         The instructions allowed in immediate-instruction and
4885         block modes are:  MOVx, MOVxI, MOVEM, ADD, ADDI, SUB, SUBI,
4886         all Booleans in normal and immediate modes, and TxZ, TxC,
4887         and TxO (i.e. all Test instructions that modify and don't
4888         skip.)
4889
4890         This call is the symbolic equivalent of the .USET and .SUSET
4891         UUO's.  It can read, write, or both (but you are usually not
4892         allowed to write any job except yourself or an inferior);
4893         it is a .SUSET if the <JOB> is %JSELF, or a .USET if given a
4894         channel number as the <JOB>, or it can be given other kinds
4895         of job specs.
4896
4897         The user variable specifier can be either numeric or sixbit.
4898         If sixbit, it is the same as the name given in the ITS USETS
4899         file except without the dot at the beginning.  Sixbit specifiers
4900         are good for programs which take arguments as to which user
4901         variable to operate on, and are useful to allow a program
4902         which uses a new variable to assemble before that variable is
4903         actually put in the system (it will get error code 11 when it
4904         tries to refer to the variable.)
4905
4906         A numeric specifier is a small integer similar to those used
4907         with the .USET and .USET uuos.  Predefined symbols exist for
4908         these, consisting of ".R" followed by the name of the variable.
4909         (Use ".R" rather than ".S" even if you are writing.)  Do not
4910         use the symbols without the "R" (these are something else.)
4911         The .IOC, .IOS, .IOP, and .PMAP arrays of user variables
4912         can only be specified numerically.
4913
4914         See the .SUSET and .USET UUO's (in .INFO.;ITS UUOS)
4915         for more information on particular user variables.
4916
4917 Errors:
4918
4919  11     ILLEGAL FILE NAME
4920         Unrecognized sixbit user variable specifier, or numeric specifier
4921         larger than the legal range.
4922  12     MODE NOT AVAILABLE
4923         The specified variable is not available for the current combination
4924         of reading versus writing and self versus other job.
4925  13     FILE ALREADY EXISTS
4926         Attempt to cause two jobs in the system to have the same UNAME/JNAME pair.
4927  31     CAN'T MODIFY JOB
4928         Attempt to write into a user variable of a job which is not writable.
4929  33     MEANINGLESS ARGS
4930         Attempt to specify an illegal instruction in immediate-
4931         instruction or block mode; or attempt to store an illegal value
4932         into a user variable (e.g. zero into the .UNAME).
4933  34     WRONG TYPE DEVICE
4934         Attempt to access user variables of the pdp-6 other than .UIND
4935         or .MEMT.
4936  40     NOT TOP LEVEL
4937         Attempt to set a user variable for a job that is not top level,
4938         when only top-level jobs are allowed to set that variable, for
4939         example the .UNAME and .JNAME.
4940 \f
4941 VIDBUF: request/release video buffer
4942
4943         arg 1   If non-negative, the number of a video buffer
4944                 to release.  If negative, requests a video buffer.
4945         val 1   If arg 1 was negative, the number of the buffer obtained.
4946
4947         A video buffer for the PDP-11 TV consoles is assigned or
4948         released.  If assigned, the video switch input number
4949         of that buffer is returned.  This value can be placed
4950         in bits 4.1-3.3 of the .TVCREG user variable in order to
4951         cause video buffer pages in one's page map to refer to
4952         the allocated video buffer.
4953
4954         A video buffer is a segment of PDP-11 memory large enough
4955         to represent all the bits on a TV display.  A display
4956         is 1100=576. bits wide by 706=454. lines high.  Every
4957         line is represented by 36. 16.-bit PDP-11 words;
4958         this corresponds to 18. PDP-10 words as mapped through
4959         the PDP-10 to PDP-11 interface (see the T11MP symbolic
4960         system call).  The word with the lowest address holds
4961         the leftmost displayed bits; furthermore within each word
4962         bit 15 is the leftmost displayed bit.  Thus, as seen by the
4963         PDP-10 bits are displayed in the "obvious" manner.
4964         The entire buffer is 16344.=37730 PDP-11 words long;
4965         this corresponds to 8172.=17754 PDP-10 words.
4966         The word 77777 PDP-11 words (17777 PDP-10 words) from the
4967         origin of the video buffer is a special control register:
4968         3.2-2.9 15-13   Unused.
4969         2.8     12      0 => white on black, 1 => black on white.
4970         2.7-1.5 11-00   Scroll offset: video buffer wraps around;
4971                         the first word displayed is that 4*<offset>
4972                         PDP-11 bytes from the buffer origin.  For
4973                         best results this should be a multiple
4974                         of 9 (for vertical scrolling).
4975         The PDP-11 always sees a video buffer as beginning at its
4976         location 60000 (byte address); which video buffer it is looking
4977         at is controlled by the console register at location 164044 octal.
4978         Thus the PDP-11 sees the scroll register as being at address
4979         157776 octal.
4980
4981         See also the VIDSW symbolic system call.
4982 Errors:
4983
4984   4     FILE NOT FOUND
4985         Attempt to release a buffer not assigned to the job.
4986   7     DEVICE NOT READY
4987         The PDP-11 is not ready.
4988  33     MEANINGLESS ARGS
4989         Arg 1 is non-negative but not a valid video buffer number.
4990 \f
4991 VIDSW:  set video switch
4992
4993         arg 1   Video switch input number.
4994         arg 2   Video switch output number.
4995
4996         The video switch is set up so that the specified video
4997         output will gobble bits from the specified video input.
4998
4999         As of July 25, 1975, the only video inputs are TV
5000         video buffers.  These correspond to Tnm device numbers
5001         as follows:
5002
5003         Tnm     Video Input Number
5004         T47     24              T47 is used for console free buffer.
5005         T52     1               When you type ESC<n>S, <n> is
5006         T53     2               the video input number.  The PDP-11
5007         T54     5               merely switches that input to your
5008         T55     6               TV display, which is a video output.
5009         T56     7
5010         T57     10
5011         T60     21
5012         T61     22
5013         T62     23
5014
5015         The possible video outputs are mostly TV displays, but also
5016         the Tektronix hard-copy device which sits next to the XGP.
5017         (The keyboard number may be relevant to use of the TVWHER
5018         symbolic system call.)  As of July 25, 1975:
5019
5020         Video Output    Keyboard        Location of TV
5021          0               0              809 Fahlman, Holloway, Knight
5022          1              14              820 Minsky
5023          2              21              824 Rich, McDonald, deKleer
5024          3               6              815 Freiling, Perez, Ullman
5025          4              10              817 Jabari
5026          5              22              825 Freuder, Grossman, Purcell
5027          6               4              813 Hewitt
5028          7               5              814 Brown, McDermott, Sussman
5029         10              13              819 Goldstein, Woods
5030         11              17              822 Marr, Sandewall
5031         12              35              915 Cohen, Gosper, etc.
5032         13              34              913 Baisley, Greenblatt
5033         14              33              334 Lebel
5034         15              30              925 Jarvis, Moon
5035         16              31              918 Freeman
5036         17              32              920 Computer room, near PDP-11
5037         20               3              812 Yvonne, Williams
5038         21              36              912 9th Floor Lounge
5039         22              37              914 Larson, Lebel, Mousouriss
5040         23              1               810 Kuipers
5041         27              Tektronix hard-copy output device.
5042
5043 Errors:
5044
5045   7     DEVICE NOT READY
5046         The PDP-11 is not ready.
5047 \f
5048 WHOLIN: examine and set TV who-line                             (ITS TV)
5049
5050         arg 1   <TTY> or <JOBDEV>
5051                 Must be a TV terminal if a <TTY>.
5052         arg 2   If present, used to set new who mode:
5053                 -1      No who-line.
5054                 0       User who-line; migrates with TTY.
5055                 1       User who-line; frozen on who job.
5056                 4       System who-line.
5057         arg 3   If present, used to set new who <JOB>.
5058         val 1   Old who mode.
5059         val 2   Old who job.
5060
5061         The TTY must be specified by a channel number and not
5062         by 400000 + tty number if the variables are to be altered.
5063
5064         See ITS TV.
5065
5066 Errors:
5067
5068   1     NO SUCH DEVICE
5069         No tty exists with the specified number.
5070  10     DEVICE NOT AVAILABLE
5071         The PDP-11 which services the TV consoles is down.
5072  34     WRONG TYPE DEVICE
5073         The specified tty was not a TV, or the specified
5074         channel was not a <TTY> or <JOBDEV>.
5075 \f
5076 WHYINT: Find out reason for second-word interrupt
5077
5078         arg 1   channel # (or <JOBDEV>)
5079
5080         val 1   %WY code (see below)
5081         val 2-n device-dependent
5082
5083         This system call is the standard response to a second-word
5084         (.IFPIR) interrupt.  The first value returned is a code
5085         number which indicates the type of device on the channel.
5086         Usually a program will know what type of device is present,
5087         because it only tries to use one type, but this value
5088         is provided just in case.  The codes are:
5089
5090                 1    %WYTYI     TTY input
5091                 2    %WYTYO     TTY output
5092                 3    %WYSTI     STY input
5093                 4    %WYSTO     STY output
5094                 5    %WYNET     (Arpa)NET
5095                 6    %WYCHA     CHAosnet
5096                 7    %WYTCP     TCP Internet
5097         The device-dependent values returned are:
5098
5099         For a TTY input channel:
5100         val 1   %WYTYI
5101         val 2   character typed.  Reading characters this way
5102                 does not interfere with later reading them via
5103                 normal IOT.  This allows characters to be processed
5104                 both as interrupt characters at the time they are
5105                 typed, and as normal input.  The call fails to
5106                 skip if there are no more interrupt characters.
5107                 The program should keep calling WHYINT until
5108                 it fails to skip, then DISMIS the interrupt.
5109
5110         For a TTY output channel:
5111         val 1   %WYTYO
5112         val 2   bit mask of reasons.  The only reason that presently
5113                 exists is:
5114                         4.9     --MORE-- interrupt.  (Typeout reached
5115                                 the bottom of the screen.)
5116
5117         For a STY input channel:
5118         val 1   %WYSTI
5119
5120         For a STY output channel:
5121         val 1   %WYSTO
5122
5123         For a NET (Arpanet NCP) channel:
5124         val 1   %WYNET
5125         val 2   Sign bit 1 if "network interrupt" received.
5126                 Right Half Socket state:
5127                 0       %NSCLS  Connection closed.
5128                 1       %NSLSN  Listening for RFC.
5129                 2       %NSRFC  RFC received while listening.
5130                 3       %NSRCL  CLS received while in %NSRFC state.
5131                 4       %NSRFS  RFC sent.
5132                 5       %NSOPN  Connection open.
5133                 6       %NSRFN  RFNM wait on write link.
5134                 7       %NSCLW  CLS sent, waiting for matching CLS.
5135                 10      %NSCLI  CLS received but input still available.
5136                 11      %NSINP  Input available.
5137         val 3   Number of bytes of input available (if input channel).
5138                 Number of bytes free in output buffer (if output channel.)
5139         val 4   Close reason.  Only valid if val 2 is %NSCLS.
5140                 0       %NCNTO  Never opened.
5141                 1       %NCUSR  Closed by user.
5142                 2       %NCFRN  Closed by foreign host.
5143                 3       %NCRST  Foreign host reset itself.
5144                 4       %NCDED  Foreign host dead.
5145                 5       %NCINC  Incomplete transmission.
5146                 6       %NCBYT  Byte size mismatch.
5147                 7       %NCNCP  Local NCP went down (local host dead).
5148                 10      %NCRFS  Request for Connection rejected by fgn host.
5149
5150         For a TCP channel:
5151         val 1   %WYTCP
5152         val 2   state code (see below)
5153         val 3   input: # bytes avail, output: # bytes free in buffer
5154         val 4   Close reason (same values/meanings as for NET.  See
5155                 definition of %NX== in SYSTEM;BITS > if curious.)
5156
5157         The TCP state codes are defined in SYSTEM;BITS > at %NT==:
5158         ; Legend: - Pre-Open, * Open, + Post-open, ? impossible.
5159         ;       I = can read, O = can write.
5160         ; Note that the input and output channels for a TCP connection
5161         ; will usually have different states.  Also, note that
5162         ; for all practical purposes, %NT and %NS symbols with the same
5163         ; value have the same meaning.  SYN = Request for connection.
5164                         ; In Out
5165         %NTCLS==:0      ; -  -  Closed (reason available from WHYINT)
5166         %NTLSN==:1      ; -  -  Listening for a SYN
5167         %NTSYR==:2      ; -  -  SYN received
5168         %NTCLU==:3      ; +  ?  Being closed by fgn host
5169         %NTSYN==:4      ; -  -  SYN sent, waiting for response
5170         %NTOPN==:5      ; *I *O Open
5171         %NTWRT==:6      ; ?  *O Output buffer full
5172         %NTCLX==:7      ; ?  +  Being closed by user
5173         %NTCLI==:10     ; +I ?  Closing/closed, input still available
5174         %NTINP==:11     ; *I ?  Open, input available
5175
5176
5177         Chaosnet:
5178         val 1 - %WYCHA
5179         val 2 - state
5180         val 3 - number of packets queued (receive,,transmit)
5181         val 4 - window size (receive,,transmit)
5182         val 5 - input channel#,,output channel# (-1 if not open or I/O-pushed)
5183
5184         LH(val 3) is the number of packets available to input IOT.
5185                   This is different from the number of received packets
5186                   if some are out of order.  This is increased by 1 if
5187                   there is a partially-read buffer available to SIOT;
5188                   this packet is not available to PKTIOT.  This is zero
5189                   if the connection is direct-connected to a STY.
5190
5191         RH(val 3) is the number of packet slots available in the output
5192                   window, i.e. the window size minus the number of packets
5193                   which have been transmitted by output IOT but which have
5194                   not yet been received and acknowledged by the foreign
5195                   host.
5196                   
5197         The state codes are:
5198
5199                 %CSCLS  Closed
5200                 %CSLSN  Listen
5201                 %CSRFC  RFC-received
5202                 %CSRFS  RFC-sent
5203                 %CSOPN  Open
5204                 %CSLOS  Broken by receipt of "LOS" packet.
5205                 %CSINC  Broken by incomplete transmission (no acknowledge
5206                         for a long time)
5207
5208 Errors:
5209
5210 34      WRONG TYPE DEVICE
5211         The specified channel supposedly never gives interrupts.
5212 \f
5213 XGPIM:  xerox graphic printer image output
5214
5215         arg 1   Address of a word with the number of pages of
5216                 data in the left half and the number of the first
5217                 data page in right half.
5218                 This word must be in writable memory.
5219
5220         Bits are shoved out onto the XGP.
5221
5222         I wonder what the precise semantics of this kludge are?