Consolidate license copies
[its.git] / sysdoc / _calls.127
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 3 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 LOCK device, the first file name is the name of the lock to
2653         seize.  Control bit 1.4 causes the open to hang if the lock is
2654         already locked.  See ITS LOCKS for details.
2655
2656         For the UBI device, the first file name is of the form:
2657         <Unibus adaptor number>,,<Interrupt address>.
2658
2659         For the PTR and PTP devices (paper tape reader and
2660         punch), if the 1.4 control bit is on, then the 1.2 bit
2661         must be 0 and the 1.3 bit is ignored.  In this mode
2662         all eight paper tape channels may be read or punched.
2663
2664         For the NET device, the arguments are as follows:
2665         cbits   2.1-2.6 byte size for image mode
2666                 1.7     Use 8 times as large a buffer.
2667                 1.6     If ascii mode, use 8-bit bytes
2668                         instead of 7-bit bytes.
2669                         If image mode, use byte size in
2670                         bits 2.1-2.6.
2671                 1.5     Open socket in listen mode.
2672                 1.4     0 = use arg 3 as local socket number.
2673                         1 = generate unique local socket number.
2674                         (A generated socket number can be examined
2675                         after opening by using the .RCHST uuo).
2676                 1.1-1.3 Standard.
2677         arg 1   Channel number.
2678         arg 2   Left-justified device name (i.e. NET).
2679         arg 3   Local socket number.
2680         arg 4   Foreign socket number.
2681         arg 5   Foreign host number.
2682
2683         For the STK device (Stanford keyboard):
2684         cbits   1.7     If 1.6 = 1 and 1.5 = 0,
2685                         then don't input the meta bit.
2686                 1.6     0 = Stanford mode:
2687                                 meta = 400
2688                                 ctrl = 200
2689                                 top+shift+others generate 0-177
2690                         1 = ITS mode:
2691                                 meta = 200
2692                                 ctrl means ctrl, and works
2693                                 with others to generate 0-177
2694                 1.5     0 = convert according to 1.6-1.7.
2695                         1 = don't convert characters.
2696                 1.4     Don't hang if no character
2697                         available for input - return -1
2698                         instead.
2699
2700         If the device name used in the OPEN is not one known to
2701         to the system, the "unknown-device handler" is invoked.
2702         The system creates a job device and loads SYS:ATSIGN DEVICE
2703         into it; this program then has the responsibility for
2704         handling the OPEN.  The normal action of this program is
2705         to look for a file DSK:DEVICE;JOBDEV <name>, where <name>
2706         is the requested device name.  For example, if an attempt
2707         is made to OPEN the FOOBAR device, and the file
2708         DSK:DEVICE;JOBDEV FOOBAR exists, the program contained in
2709         this file will be used to interpret the OPEN via the JOB device.
2710         If such a file does not exist, but the device name has trailing
2711         digits, the unknown-device handler will try stripping successive
2712         trailing digits and retrying.  For example, opening the
2713         AR1 device causes the unknown-device handler to look first for
2714         JOBDEV AR1, and then for JOBDEV AR.  If the handler succeeds,
2715         it sets device name for PEEK and who-lines to the second
2716         file name that finally succeeded (see the JOBSTS symbolic
2717         system call).
2718         The unknown-device handler also handles requests for the
2719         directories of certain built-in devices whose directories
2720         are seldom asked for.  If there is nothing better to return for
2721         a directory, the string "NON-DIRECTORY DEVICE" is returned.
2722
2723 Errors:
2724
2725         OPEN can return many errors.  The following errors in
2726         particular are relevant to OPEN on the DSK device:
2727
2728   4     FILE NOT FOUND
2729         The specified directory exists, but the specified file
2730         does not.
2731   5     DIRECTORY FULL
2732         There is no room in the directory to create an entry
2733         for the new output file.
2734   7     DEVICE NOT READY
2735         The disk pack containing the file is offline (should
2736         never really happen).
2737  10     DEVICE NOT AVAILABLE
2738         a specific unit was selected, by opening DKn, and that
2739         unit is off-line or contains a reserved pack.  Or, a
2740         specific pack was selected by opening PKn or Pnn,
2741         and that pack is reserved.  The reserved-pack check
2742         only applies when writing.  Reserved means secondary-pack,
2743         or reserved for the exclusive use of certain directories.
2744  11     ILLEGAL FILE NAME
2745         One or both file names were zero; or, for an output file,
2746         the file names were M.F.D. (FILE) or .FILE. (DIR), which
2747         are names reserved for directories.
2748  12     MODE NOT AVAILABLE
2749         Control bits 2.9-2.7 specified an illegal mode.
2750  14     BAD CHANNEL NUMBER
2751         This is a RENMWO error.
2752  16     PACK NOT MOUNTED
2753         The pack specified by opening PKn or Pnn is not
2754         mounted, or the pack containing the file being read
2755         is not mounted.
2756  20     NON-EXISTENT DIRECTORY
2757         The specified directory does not exist.
2758  22     SELF-CONTRADICTORY OPEN
2759         Control bits 2.9-2.7 specified an illegal mode.
2760  23     FILE LOCKED
2761         An attempt to open a file in write-over mode failed
2762         because someone has the file open for reading; or
2763         an attempt to open a file for read, write-over, rename,
2764         or delete failed because someone is writing the file
2765         or because the file has been deleted, but hasn't gone
2766         away yet because someone is reading it (i.e. there is
2767         a star next to it in the directory listing.)  wait a while
2768         and try again.
2769  24     M.F.D. FULL
2770         Cannot create a new directory because the master file directory
2771         is full.
2772  27     LINK DEPTH EXCEEDED
2773         Links may not be chained to a length of greater than 100 links.
2774         This error probably means a circular chain of links.
2775  47     LINK TO NON-EXISTENT FILE
2776         Error 4 or 20 occurred after following a link.
2777 \f
2778 PDUMP:  pure dump a job
2779
2780         arg 1   <JOB>.
2781         arg 2   Disk output channel number.
2782                 Should have been freshly opened
2783                 for output.
2784         arg 3   State word; should be 0 initially.
2785                 This word is updated as the PDUMP
2786                 progresses; a value of 400000,,<n> means
2787                 that page <n> is about to be dumped.
2788
2789         The pages of the specified job are dumped onto
2790         the disk file in a form that can be efficiently
2791         loaded.  In particular, information as to whether
2792         each page is read-only or not is saved so that
2793         when the program is run it can be swapped
2794         efficiently.  If the same file is loaded into
2795         several jobs, they will all share the same
2796         physical copies of the read-only pages.
2797         In addition, absolute pages are remembered.
2798         A number of 2000-word (1K) blocks are dumped onto
2799         the file.  The first block is as follows:
2800         wd 0            Contains zero.  This distinguishes
2801                         PDUMP'ed programs from, for example,
2802                         MIDAS output.
2803         wds 1-400       Word <n> contains information about
2804                         block <n-1> of the dumped job.  This
2805                         information is as follows:
2806                         4.9     Absolute page (shared with system).
2807                         2.9-2.8 00      Non-existent page.
2808                                 01      Read-only page.
2809                                 10,11   Read/write page.
2810                         2.2-1.1 If 4.9=1, absolute page number.
2811         wds 401-777     Zero.
2812         wds 1000-1017   The contents of the accumulators.
2813                         Note that the accumulators aren't part of
2814                         any page, so they wouldn't be saved if it were
2815                         not for this special hack.
2816         The following blocks of the file are the successive
2817         pages of the job, but only those which need to be dumped.
2818         That is, absolute and non-existent pages are not dumped.
2819         Thus, suppose the pages of a job are laid out as follows:
2820                 pg 0    Read/write.
2821                 pg 1-5  Read-only.
2822                 pg 6-7  Absolute (e.g., system symbol table).
2823                 pg 100  Read/write.
2824                 pg 200  Read/write.
2825                 others  Non-existent.
2826         Then nine blocks would be dumped out:
2827                 blk 0   Descriptor block.
2828                 blk 1   Page 0.
2829                 blk 2-6 Pages 1-5.
2830                 blk 7   Page 100 (octal).
2831                 blk 10  Page 200 (octal).
2832         This is all that PDUMP writes out, leaving the file's access
2833         pointer at the end of the last block written.  At this point
2834         the job doing the PDUMP will normally write out the
2835         symbol table, if any, for the dumped job onto the disk
2836         channel, preceded and followed by JUMPA instructions
2837         containing the starting address.  When this is done,
2838         the resulting file can be loaded and run as a program
2839         under DDT.
2840         See the LOAD symbolic system call.
2841
2842 Errors:
2843
2844  14     BAD CHANNEL NUMBER
2845  31     CAN'T MODIFY JOB
2846         Can't dump the PDP-6 job.
2847  34     WRONG TYPE DEVICE
2848         First argument was some oddball channel, or
2849         second argument was not a disk output channel number.
2850  35     NO SUCH JOB
2851 \f
2852 PGWRIT: Cause page to be written to disk
2853
2854         arg 1   (Optional)  A <JOB>
2855         arg 2   Virtual page number within that job (a number from 0 to 377).
2856         control bits:
2857         1.1     1 => don't wait for the page to finish getting written out,
2858                      return immediately.  Issue the call again with this bit 0
2859                      if you later want to wait for it to get written out.
2860         1.2     1 => unlock the page.
2861                 0 => if the page is locked, swap it out anyway, but when it
2862                      next gets swapped in again it will be locked again.
2863
2864         If there is only one argument, it is arg 2.  The <JOB> is
2865         assumed to be the job issuing the call.
2866
2867         The disk copy of the specified page is brought up to date;
2868         if the in-core copy has been modified by the specified <JOB>
2869         the page is written out.  The PGDUMP call does not return until
2870         the disk has finished recording the page.
2871
2872         This is useful when pages of a file have been mapped into
2873         the user's address space.
2874
2875         If the page cannot be swapped out because no disk space is available,
2876         or some job that is using it cannot be pclsr'ed, it waits a while
2877         and tries again.  It does not return.
2878
2879         This call used to be called PGDUMP, but the name was
2880         changed to avoid confusion with PDUMP.
2881
2882 Errors:
2883
2884  12     MODE NOT AVAILABLE
2885         Page is absolute or tied down by exec pages.
2886  14     BAD CHANNEL NUMBER
2887         The <JOB> argument is invalid.
2888  31     CAN'T MODIFY JOB
2889         Executing job doesn't have modification rights to the job
2890         specified by argument 1.
2891  32     CAN'T GET THAT ACCESS TO PAGE
2892         The page number in argument 2 is not between 0 and 377; or the
2893         job does not have a page at that position in its address space.
2894  34     WRONG TYPE DEVICE
2895         The <JOB> specifies the pdp-6, which does not have paging.
2896  35     NO SUCH JOB
2897         The <JOB> argument specified a non-existent job.
2898 \f
2899 PKTIOT: transfer one Chaosnet packet                    <MOON;CHAORD>
2900         arg 1 - channel number
2901         arg 2 - address of a 126.-word block.
2902
2903         Always transfers exactly one packet.
2904         The format of the 126.-word block is:
2905                          16               16          4
2906                 -----------------------------------------
2907                 | opcode | unused | fc |   nbytes   | 0 |
2908                 -----------------------------------------
2909                 |destination host |destination index| 0 |
2910                 -----------------------------------------
2911                 |   source host   |   source index  | 0 |
2912                 -----------------------------------------
2913                 |    packet #     |  ack packet #   | 0 |
2914                 -----------------------------------------
2915                 | data1  |  data2  ...
2916         
2917                                             ... data487 |
2918                 -----------------------------------------
2919
2920         For details of how to use these packets, see the Chaosnet
2921         protocol documentation.
2922 \f
2923 RAUTH:  read a file's author.
2924
2925         arg 1   Number of a channel open on the DSK device,
2926                 or a <JOBDEV>.
2927
2928         val 1   Sixbit name of the file's author (the last
2929                 person to write on the file.)
2930 \f
2931 RCHST:  read channel status.
2932         Note:  This system call is obsolete.  Use the RFNAME,
2933                 RFPNTR, or WHYINT system call to obtain the
2934                 information you want.
2935
2936         arg 1   channel number
2937
2938         val 1   The fullword sixbit name of the device open
2939                 on the specified channel, or 0 if the channel
2940                 is closed.
2941         val 2   The first file name of the file open on the
2942                 channel, or 0 if filenames mean nothing on
2943                 the device which is open.
2944         val 3   The second file name, or 0.
2945         val 4   The directory name of the open file, assuming
2946                 that "directory name" has some meaning for the
2947                 device which is in use; otherwise, 0.
2948         val 5   The channel's access pointer, if it is randomly
2949                 accessible; otherwise, -1.
2950         val 6...additional device-dependent results
2951
2952         The values may not be the same as the filenames, etc.
2953         that were used to open the channel.  The results of
2954         this call are quite device-dependent.
2955         in the open-mode returned by RCHST.
2956
2957         The following devices return the access pointer as -1
2958         and the filenames and directory name as 0:
2959         NUL     LPT     NVD     PLT     PTP     IMX     OMX
2960         PTR     DIS     IDS     COD     TVC     TAB     MT0
2961         MSP     STK
2962
2963         The data stored by other specific devices is described below.
2964         If a specific numbered value is not mentioned, then the default
2965         is returned by that device - 0 for values 2, 3 and 4;
2966         -1, for value 5.
2967
2968         DIRECTORIES
2969         val 1   The device name
2970         val 2   sixbit/.FILE./
2971         val 3   sixbit/(DIR)/
2972         val 4   the directory name, on a multi-directory device
2973
2974         DISK MFD's
2975         val 1   sixbit/DSK/
2976         val 2   sixbit/M.F.D./
2977         val 3   sixbit/(FILE)/
2978
2979         ERR
2980         val 1   'ERR,,
2981         val 2   3
2982         val 3   a word in the format of a channel status word,
2983                 which has the error codes that the ERR device
2984                 is describing.
2985
2986         Closed channel:
2987         vals 1-4 0
2988         val 5   -1
2989
2990         TTY (as a console)
2991         val 1   'TTY,,
2992
2993         TTY (as a device)
2994         val 1   'Tnm,,
2995
2996         STY
2997         val 1   'Snm,,
2998
2999         USR (including PDP-6)
3000         val 1   'USR,,
3001         val 2   Uname of job.
3002         val 3   Jname of job.
3003         val 4   0
3004         val 5   Access pointer.
3005
3006         UTn (micro-tape)
3007         val 1   'UTn,,
3008         val 2   File name 1.
3009         val 3   File name 2.
3010         val 4   Uname assigned to, or zero if none (see the .ASSIGN uuo).
3011
3012         CLI, CLO, CLA, CLU
3013         val 1   'CLO,,
3014         val 2   File name 1.
3015         val 3   File name 2.
3016         val 4   Sname.
3017
3018         DSK
3019         val 1   'DSK,,
3020         val 2   File name 1.
3021         val 3   File name 2.
3022         val 4   Directory name.
3023         val 5   Access pointer.  May be a byte pointer if character mode.
3024
3025         BOJ
3026         val 1   'BOJ,,
3027         val 2   Uname of creator (zero if he has gone away).
3028         val 3   Jname of creator (zero if he has gone away).
3029
3030         JOB
3031         vals 1-n        Whatever the job device decides to return.
3032                 See the JOBSTS and JOBRET symbolic system calls.
3033                 Note that the job sets the results for vals 1-4 once
3034                 using the JOBSTS call, and only the values 5, 6, ...
3035                 are taken from the JOBRET that responds to the RCHST.
3036
3037         NET
3038         val 1   'NET,,
3039         val 2   Local socket number.
3040         val 3   Foreign socket number.
3041         val 4   4.9     Network interrupt (INR/INS) received.
3042                 2.9-2.1 Byte size.
3043                 1.9-1.1 Foreign host number.
3044         val 5   4.9-3.1 Time until IMP goes down, in thirtieths
3045                         of a second.
3046                         0 => IMP down.
3047                         -1 => IMP doesn't plan to go down.
3048                 2.9-1.1 Socket state:
3049                         0       %NSCLS  CLS received.  val 6 gives reason.
3050                         1       %NSLSN  Listening for RFC.
3051                         2       %NSRFC  RFC received while listening.
3052                         3       %NSRCL  CLS received while in RFC received state.
3053                         4       %NSRFS  RFC sent.
3054                         5       %NSOPN  Connection open.
3055                         6       %NSRFN  RFNM wait on write link.
3056                         7       %NSCLW  CLS sent.  Waiting for matching CLS.
3057                         10      %NSCLI  CLS received, but input still available.
3058                         11      %NSINP  Input available.
3059         val 7   Reason for closing:
3060                 0       %NCNTO  Never open.
3061                 1       %NCUSR  Closed by user.
3062                 2       %NCFRN  Closed by foreign host.
3063                 3       %NCRST  Foreign host Reset itself.
3064                 4       %NCDED  Foreign host dead.
3065                 5       %NCINC  Incomplete transmission.
3066                 6       %NCBYT  Byte size mismatch.
3067                 7       %NCNCP  Local NCP went down.
3068                 10      %NCRFS  Connection refused.
3069         val 8   Input: number of bits available.
3070                 Output: number of bits of buffer free.
3071
3072         TCP: (Internet TCP)
3073         val 1   SIXBIT /TCP/
3074         val 2   Local port #
3075         val 3   Foreign port #
3076         val 4   Foreign net address (HOSTS3 format)
3077
3078         Chaosnet:
3079         val 1   SIXBIT /CHAOS/
3080         val 2   Local index
3081         val 3   Foreign index
3082         val 4   Foreign net address (HOSTS3 format)
3083
3084         SPY:
3085         val 1   SIXBIT /SPY/
3086         val 2   TTY number
3087
3088         DIRHNG:
3089         val 1   SIXBIT /DIRHNG/
3090         val 2   0
3091         val 3   0
3092         val 4   Directory name
3093
3094         LOCK:
3095         val 1   SIXBIT /LOCK/
3096         val 2   Lock name
3097
3098         UBI:
3099         val 1   SIXBIT /UBI/
3100         val 2   <Unibus adaptor number>,,<Interrupt address>
3101 \f
3102 RCPOS:  read cursor position                                    (ITS TTY)
3103
3104         arg 1   <TTY> or <JOBDEV>
3105         val 1   Main program area cursor position.
3106         val 2   Echo area cursor position.
3107
3108         Each cursor position is returned as a word with the
3109         vertical position in the left half and the horizontal
3110         position in the right half.
3111         See the SCML symbolic system call for setting up an
3112         echo area.
3113 \f
3114 RDDMST: read demon status
3115
3116         arg 1   Either the sixbit name or the user index
3117                 of a demon job.
3118         val 1   If arg 1 was the sixbit name, the user index;
3119                 if it was the user index, the sixbit name.
3120         val 2   4.9-3.1 If non-zero, the time in two-minute ticks
3121                         between automatic signals for the demon.
3122                 2.9-1.1 Number of requests pending for the demon.
3123         val 3   Time in two-minute ticks until the next automatic
3124                 signal will occur (meaningful only if arg 2 bits
3125                 4.9-3.1 not zero).
3126
3127         See also the DEMSIG and STDMST symbolic system calls,
3128         and the .DEMON uuo.
3129 \f
3130 RDMPBT: read dump bit
3131
3132         arg 1   Disk channel number or <JOBDEV>
3133         val 1   A word, all zero, except with the dump check
3134                 bit for the file in bit 1.1.
3135
3136         The dump check bit is used by the magtape file backup
3137         system to keep track of which files have been backed
3138         up on magtape.  This bit therefore should not be
3139         twiddled light-heartedly.  The "!" you sometimes see
3140         in front of a date in a disk file directory is present
3141         iff the dump check bit for the file is zero.
3142
3143         See also the .DMPCH uuo and the SDMPBT
3144         symbolic system call.
3145 \f
3146 RELOAD: reload top-level job                                    (ITS DETACH)
3147
3148         No arguments or values.  Note, however, that an
3149         argument of some kind must be supplied so that the
3150         SETZ bit may be present to terminate the set of
3151         arguments.
3152
3153         The executing job must be the top level job of
3154         a non-disowned job tree.
3155
3156         Most of the job's system variables are initialized;
3157         the file  SYS:ATSIGN <jname>  is then loaded and
3158         started up, where <jname> is the jname of the job
3159         (see the .JNAME user variable).
3160         For example, if the jname of the job is HACTRN,
3161         then the file  SYS:ATSIGN HACTRN  (which is DDT)
3162         is loaded and started.  This is how DDT performs
3163         the \eU. command.  Note that the translation lists for
3164         the job are not cleared before this loading; thus one
3165         can translate the file names  SYS:ATSIGN <jname>  and
3166         cause a different file to be loaded.
3167
3168         More specifically, the way the job is loaded is that
3169         the following program is put into the job's ac's
3170         and started at location 0:
3171
3172         0/      JFCL            ;unused word
3173         1/      .OPEN 1,7       ;open up file SYS:ATSIGN <jname>
3174         2/       JRST 0         ;retry on failure
3175         3/      .CALL 12        ;load up program
3176         4/       .LOGOUT        ;logout if loading fails
3177         5/      .IOT 1,2        ;read in starting address
3178         6/      JRST (2)        ;go there
3179         7/      4,,'SYS         ;SYS device, image unit input
3180         10/     SIXBIT \ATSIGN\
3181         11/     0               ;<jname> is placed here
3182         12/     SETZ
3183         13/     SIXBIT \LOAD\   ;load file into job
3184         14/     16              ;job specification
3185         15/     SETZ 17         ;channel number
3186         16/     -1              ;job is me
3187         17/     1               ;channel number is 1
3188
3189         Typically the first thing a job used as a top level
3190         (such as DDT) does is close channel 1.  Now you know
3191         why.  The LOAD system call leaves channel 1 open
3192         so that the start address and symbol table can be
3193         read in.
3194
3195 Errors:
3196
3197  40     NOT TOP LEVEL
3198 \f
3199 RENAME: rename a file
3200
3201   Either
3202         arg 1   Byte pointer to ASCIZ string specifying the old name,
3203                 or AOBJN pointer to block of byte pointers,
3204         arg 2   Byte pointer to ASCIZ string specifying the new name,
3205                 or AOBJN pointer to block of byte pointers,
3206
3207   Or
3208         arg 1   Left-justified device name.
3209         arg 2   Old file name 1.
3210         arg 3   Old file name 2.
3211         arg 4   Sname.  If zero, the executing job's sname
3212                 is used (see the .SNAM user variable).
3213         arg 5   New file name 1.
3214         arg 6   New file name 2.
3215
3216         The file specified by the first four names is renamed
3217         according to the last two.  It is not possible to
3218         "rename" a file into a new directory or device.
3219         Attempting to rename to an already existing file will
3220         fail with error code 13 (File already exists).
3221
3222         The old file names are subject to file name translation.
3223         See the TRANAD and TRANDL symbolic system calls.
3224
3225         See the SOPEN symbolic system call for how the byte or AOBJN
3226         pointer argument should be formatted and how the string(s) are
3227         parsed.
3228
3229         See also the .FDELE uuo.
3230 \f
3231 RENMWO: rename while open
3232
3233   Either
3234         arg 1   Channel number of channel with file open on it.
3235         arg 2   Byte pointer to ASCIZ string specifying the new name,
3236                 or AOBJN pointer to block of byte pointers,
3237
3238   Or
3239         arg 1   Channel number of channel with file open on it.
3240         arg 2   New file name 1.
3241         arg 3   New file name 2.
3242
3243         The file open on the specified channel is renamed
3244         according to the specified names.
3245
3246         Ordinarily this is used in connection with output.  Often
3247         one opens a file for output with artificial file names, for
3248         instance _TECO_ OUTPUT, instead of the real desired names.
3249         This is so that if something should happen, causing the
3250         channel to be closed before writing to the file is finished,
3251         any previous file with the desired names will not be
3252         replaced by the new, incomplete file.  When all the
3253         necessary data have been written into the file,
3254         one RENMWO's to the desired names and then CLOSE's.
3255         This causes the new, good file to replace the old one of
3256         the same names.  (By convention, file names beginning
3257         with "_" are artificial names reserved for this purpose.
3258         Ordinarily a program FOO will use the first file name
3259         _FOO_ and a second file name indicating the nature of
3260         the output file; thus _FOO_ OUTPUT, _FOO_ CRFOUT,
3261         _FOO_ LSTOUT, etc.)
3262
3263         See the SOPEN symbolic system call for how the byte or AOBJN
3264         pointer argument should be formatted and how the string(s) are
3265         parsed.
3266
3267         See also the .FDELE uuo.
3268 \f
3269 REOWN:  re-own a disowned job
3270
3271         arg 1   channel #
3272
3273         The foreign job open on the specified channel is made
3274         an inferior of the current job.  The sub-tree of that job
3275         becomes part of the sub-tree of the current job.  The UNAMEs
3276         of the specified job and all its inferiors are changed to
3277         the UNAME of the current job.  The JNAMEs are altered where
3278         necessary to keep all UNAME-JNAME pairs in the system unique.
3279
3280 Errors:
3281
3282 5       DIRECTORY FULL
3283         The current job already has the maximum number of inferiors (8).
3284 31      CAN'T MODIFY JOB
3285         The specified job is not top-level, or not disowned.
3286 34      WRONG TYPE DEVICE
3287         Specified channel is not open on the USR device,
3288         or the job is already an inferior of the current job.
3289 42      JOB GONE OR GOING AWAY
3290         The specified job is in the process of logging out.
3291 \f
3292 RESET:  reset input/output channel
3293
3294         arg 1   Channel number.
3295
3296         See also the .RESET uuo.
3297
3298         This is a device-dependent operation.  In general
3299         the intent is to reset the state of the device to
3300         some standard setting.
3301
3302         For TTY input:
3303         If the particular TTY involved is the console,
3304         wait until the executing job possesses the tty.
3305         (If the %TBINT bit is set for the job, give a
3306         word 1 interrupt on bit 4.2 if the job doesn't
3307         have the tty.)  If the TTY is in communicate mode,
3308         wait until it leaves communicate mode.
3309         All characters pending in the input buffer are
3310         thrown away.  Any interrupt characters which have
3311         not yet interrupted will not interrupt.  Any echoing
3312         characters which have not yet echoed will not echo.
3313
3314         For TTY output:
3315         If the particular TTY involved is the console,
3316         wait until the executing job possesses the tty.
3317         (If the %TBINT bit is set for the job, give a
3318         word 1 interrupt on bit 4.2 if the job doesn't
3319         have the tty.)  If the TTY is in communicate mode,
3320         wait until it leaves communicate mode.
3321         Any characters in the output buffer are thrown away
3322         iff the %TPORS bit is 1.  If the channel was hung in
3323         a **MORE**, the **MORE** is forgotten.  If the job
3324         was interrupted in the middle of ^P code typeout,
3325         the ^P is forgotten.  Other oddball state bits are
3326         also reset to their normal state.
3327         If the intelligent terminal protocol is in use on
3328         the tty, then a %TDORS code will be sent to it,
3329         and a reply stating the terminal's actual cursor
3330         position awaited before any more output is allowed.
3331         See the description of this protocol in the TTY documentation.
3332
3333         For the USR device:
3334         This is like doing a .UCLOSE and then re-opening the
3335         job, but with less overhead.  All pages of the job
3336         are flushed, and a single page, page 0, is created
3337         and cleared.  All resource variables and other variables
3338         are initialized.  The %TBNOT and %TBDTY bits are set
3339         in the .TTY variable.  The .SNAM variable is initialized
3340         to the uname of the job.  The .40ADDR variable is set
3341         to 40 octal.  The .APRC variable is set to 447 octal.
3342
3343         For the LPT device:
3344         The line currently being physically output is terminated
3345         and output.  All characters pending in the output buffer
3346         are flushed.  The printer is skipped to a new page.
3347
3348         For the PLT device:
3349         All buffered plotter commands are flushed.
3350
3351         For the PTR device:
3352         All buffered input characters are flushed.
3353
3354         For the PTP device:
3355         All buffered output characters are flushed.
3356
3357         For the COD device:
3358         All buffered output characters are flushed.
3359
3360         For the PDP-6:
3361         The core of the PDP-6 is cleared.  If it is running,
3362         this should cause it to loop, executing the zero word
3363         in location 41.  A routine is then placed in core to
3364         clear the PI flags, clear the processor flags, release
3365         all shared devices, clear the accumulators, and finally
3366         clear itself from core.  If the routine fails to run
3367         (the PDP-6 is not running), then the routine is cleared
3368         out of the PDP-6 memory again anyway.
3369
3370         For the NET device:
3371         Any pending interrupt (INR or INS) is cleared.
3372
3373         For TCP channels:
3374         Currently does nothing.
3375
3376         For the Chaosnet (channels opened with CHAOSO):
3377         Does nothing.
3378
3379         For the STY device:
3380         An input reset is much like an output reset for the
3381         tty which is the STY's alter ego; similarly, an output
3382         reset is much like an input reset for the associated tty.
3383         One difference is that a STY input reset does not
3384         reset certain channel-related bits that a tty output
3385         reset would; on the other hand, it always succeeds in
3386         flushing characters even if the %TPORS bit is not set.
3387
3388         For the STK device:
3389         All buffered input characters are flushed.
3390 \f
3391 RESRDT: restore file reference date
3392
3393         arg 1   Disk channel number or <JOBDEV>
3394
3395         The reference date for the disk file is restored to
3396         its value prior to the opening of the file.
3397         Note that control bit 1.4 avoids setting the
3398         reference date when a disk file is opened.  See
3399         the OPEN symbolic system call.
3400
3401         See also the DSKUPD, FILBLK, RQDATE and SRDATE symbolic
3402         system calls.
3403 \f
3404 RFDATE: read file creation date
3405
3406         arg 1   Disk channel number or <JOBDEV>
3407         val 1   The creation date of the file:
3408                 4.7-4.1 Year (mod 100.).
3409                 3.9-3.6 Month (January = 1).
3410                 3.5-3.1 Day of month.
3411                 2.9-1.1 Time of creation, in half-seconds
3412                         after midnight.
3413
3414         See also the RQDATE and SFDATE symbolic system calls.
3415 \f
3416 RFNAME: read name of file channel is open to
3417
3418         arg 1   <JOB> whose channel should be read. (OPTIONAL)
3419                 If omitted, self is assumed.
3420         arg 2   channel number
3421         arg 3   Optional byte pointer to store ASCIZ filename string through.
3422         arg 4   Optional maximum number of characters to store.
3423
3424         val 1   The fullword sixbit name of the device open
3425                 on the specified channel, or 0 if the channel
3426                 is closed.
3427         val 2   The first file name of the file open on the
3428                 channel, or 0 if filenames mean nothing on
3429                 the device which is open.
3430         val 3   The second file name, or 0.
3431         val 4   The directory name of the open file, assuming
3432                 that "directory name" has some meaning for the
3433                 device which is in use; otherwise, 0.
3434         val 5   The mode in which the channel is open.
3435
3436         The filenames and mode as described by the RFNAME may
3437         not be the same as those specified in the original open.
3438         That is because they are intended to be the "real"
3439         filenames, etc., as opposed to those that were specified.
3440         In other words, they are supposed to be the canonical
3441         arguments to specify to attempt to re-open the file.
3442         For example, the results of filename translation and
3443         link following will show up in the names returned by
3444         RFNAME, as opposed to the translated names or the names
3445         of the link that was followed.  Similarly, if COM or SYS
3446         is opened, RFNAME will return DSK:COMMON; or DSK:SYS;
3447         since COM and SYS are equivalent to those disk directories.
3448         The core link devices CLO, CLU, CLA and CLI
3449         perform different functions when first opened, but after the
3450         open they result in indistinguishable channels, and the file
3451         could be re-opened in any case by specifying CLO with the
3452         right filenames, so RFNAME will for all four devices return
3453         the device name CLO.
3454         Some open-mode bits also have only an initial effect, and
3455         they too are likely to be missing (or else always present!)
3456         in the open-mode returned by RFNAME.
3457
3458
3459         The following devices return the filenames and directory name as 0:
3460         NUL     LPT     NVD     PLT     PTP     IMX     OMX
3461         PTR     DIS     IDS     COD     TVC     TAB     MT0
3462         MSP     STK
3463
3464         The data stored by other specific devices is described below.
3465         If a specific numbered value is not mentioned, then the default
3466         is returned by that device - 0 for values 2, 3 and 4;
3467         bits 1.1, 1.2, 1.3 with their standard meanings
3468         for the open-mode (value 5).
3469
3470         DIRECTORIES
3471         val 1   The device name
3472         val 2   sixbit/.FILE./
3473         val 3   sixbit/(DIR)/
3474         val 4   the directory name, on a multi-directory device
3475
3476         DISK MFD's
3477         val 1   'DSK,,
3478         val 2   sixbit/M.F.D./
3479         val 3   sixbit/(FILE)/
3480
3481         ERR
3482         val 1   'ERR,,
3483         val 2   3
3484         val 3   a word in the format of a channel status word,
3485                 which has the error codes that the ERR device
3486                 is describing.
3487
3488         Closed channel:
3489         vals 1-5 0
3490
3491         TTY (as a console)
3492         val 1   'TTY,,
3493         val 5   see TTY as a device
3494
3495         TTY (as a device)
3496         val 1   'Tnm,,
3497         val 5   Bits 1.1 and 1.2 are standard.
3498                 For output channels, all the %TJ... bits
3499                 are returned also as they were in the OPEN.
3500                 For input channels, all the %TI... bits are
3501                 returned as they were specfied in the OPEN.
3502
3503         STY
3504         val 1   'Snm,,
3505         val 5   All the bits of a STY open are returned.
3506
3507         USR (including PDP-6)
3508         val 1   'USR,,
3509         val 2   Uname of job.
3510         val 3   Jname of job.
3511         val 4   0
3512         val 5   bits 1.1 and 1.2 as standard
3513                 bit 1.4 1 if the job is not an inferior
3514                 of the job which has it open.
3515
3516         UTn (micro-tape)
3517         val 1   'UTn,,
3518         val 2   File name 1.
3519         val 3   File name 2.
3520         val 4   Uname assigned to, or zero if none (see the .ASSIGN uuo).
3521
3522         CLI, CLO, CLA, CLU
3523         val 1   'CLO,,
3524         val 2   File name 1.
3525         val 3   File name 2.
3526         val 4   Sname.
3527
3528         DSK
3529         val 1   'DSK,,
3530         val 2   File name 1.
3531         val 3   File name 2.
3532         val 4   Directory name.
3533
3534         BOJ
3535         val 1   'BOJ,,
3536         val 2   Uname of creator (zero if he has gone away).
3537         val 3   Jname of creator (zero if he has gone away).
3538
3539         JOB
3540         vals 1-n        Whatever the job device decides to return.
3541                 See the JOBSTS system call.  Note that the JOB device
3542                 is not specifically consulted when the RFNAME call is
3543                 given; it sets up the file names and open mode once
3544                 and then these values are returned whenever a user
3545                 asks for them with RFNAME.
3546
3547         NET: (Arpanet NCP)
3548         Note that val 4 is slightly nonstandard.
3549         val 1   'NET,,
3550         val 2   Local socket number.
3551         val 3   Foreign socket number.
3552         val 4   4.9     Network interrupt (INR/INS) received.
3553                 2.9-2.1 Byte size.
3554                 1.9-1.1 Foreign host number.
3555
3556         TCP: (Internet TCP)
3557         val 1   SIXBIT /TCP/
3558         val 2   Local port #
3559         val 3   Foreign port #
3560         val 4   Foreign net address (HOSTS3 format)
3561
3562         Chaosnet:
3563         val 1   SIXBIT /CHAOS/
3564         val 2   Local index
3565         val 3   Foreign index
3566         val 4   Foreign net address (HOSTS3 format)
3567         val 5   0 or 1  (i.e. .UAI or .UAO)
3568
3569         SPY:
3570         val 1   SIXBIT /SPY/
3571         val 2   TTY number
3572
3573         DIRHNG:
3574         val 1   SIXBIT /DIRHNG/
3575         val 2   0
3576         val 3   0
3577         val 4   Directory name
3578
3579         LOCK:
3580         val 1   SIXBIT /LOCK/
3581         val 2   Lock name
3582
3583         UBI:
3584         val 1   SIXBIT /UBI/
3585         val 2   <Unibus adaptor number>,,<Interrupt address>
3586 \f
3587 RFPNTR: read channel's random access pointer
3588
3589         arg 1   channel # (or <JOBDEV>)
3590
3591         val 1   random access pointer
3592         val 2   channel byte size.  The acces pointer
3593                 is in terms of bytes of this size.
3594
3595         The random access pointer is the number of bytes
3596         into the file at which the next reading or writing
3597         operation will occur.
3598
3599         See also the ACCESS system call, the .ACCESS UUO,
3600         the RCHST system call, and the .RCHST UUO.
3601
3602 Errors:
3603
3604 34      WRONG TYPE DEVICE
3605         The device open on the specified channel is not random-access.
3606 \f
3607 RQDATE: read disk format date
3608
3609         val 1   Current date and time in disk format:
3610                 4.7-4.1 Year (mod 100.).
3611                 3.9-3.6 Month (January = 1).
3612                 3.5-3.1 Day of month.
3613                 2.9-1.1 Time in half-seconds after midnight.
3614                 If date and time are unknown, -1 is returned.
3615         val 2   Date and time the system came up in disk format.
3616                 If date and time are unknown, -1 is returned.
3617
3618         See also the DSKUPD, FILBLK, RESRDT, RFDATE, and SFDATE
3619         symbolic system calls.
3620 \f
3621 RSSIZE: read screen size                                        (ITS TTY)
3622
3623         arg 1   <TTY> or <JOBDEV>
3624         val 1   Vertical size of screen (huge if printing).
3625         val 2   Horizontal size of screen (print width).
3626
3627         See also the CNSGET and CNSSET symbolic system calls.
3628 \f
3629 SAUTH:  set a file's author
3630
3631         arg 1   The number of a channel open on the DSK
3632                 device, or a <JOBDEV>.
3633
3634         arg 2   The sixbit name of the file's author.
3635
3636         Note:  the author is actually stored as a directory
3637         number, so if the author does not have a directory
3638         SIXBIT /______/ will be substituted.  Trailing digits
3639         are deleted in an attempt to find the author's directory.
3640 \f
3641 SCML:   set the number of TTY command lines                     (ITS TTY)
3642
3643         arg 1   <TTY> or <JOBDEV>
3644         arg 2   Number of command lines (typical value is 4).
3645                 Must be less than the height of the screen.
3646                 If zero, no echo area.
3647
3648         This causes an echo area to be set up at the bottom
3649         of the display screen, using the last <n> lines.
3650         Characters typed in, or characters output in echo
3651         mode, are output to this area rather than the main area.
3652         Note that control bit 1.6 in an OPEN symbolic
3653         system call for TTY input does an implicit SCML
3654         with a second argument of 3.
3655 \f
3656 SCPOS:  set tty cursor position                                 (ITS TTY)
3657
3658         arg 1   <TTY> or <JOBDEV>
3659         arg 2   vertical position (optional).
3660         arg 3   horizontal position (optional).
3661         arg 4   TTOALC word (optional).
3662         val 1   old vertical position.
3663         val 2   old horixontal position.
3664         val 3   old TTOALC word.
3665
3666         This call tells the system what the main-program-level
3667         cursor position of the specified tty really is.  It
3668         does NOT request that the cursor be MOVED there;
3669         it asserts that the cursor is expected to end up there
3670         as a result of the characters already IOT'ed.
3671         This call is necessary only when the system cannot figure
3672         the resulting cursor position out for itself.
3673         There are two cases when that happens:
3674
3675         1) The system does not compute cursor motion when
3676         super-image output is done.  If the user program, which
3677         presumably knows how the characters are being used, knows
3678         that the cursor will be moved by them, it should inform
3679         the system.  This is necessary even if the user program
3680         is just trying to save time by generating the internal
3681         system output buffer codes itself.
3682
3683         2) When an output reset is done on a tty of type %TNSFW
3684         (a "software tty"), the system does not know where the
3685         tty's cursor is physically located.  Since the system
3686         does not actually interpret the output characters at
3687         interrupt level, but merely passes them off to the
3688         tty, it does not know how much the tty had done when
3689         the output reset happened.  To recover, the system
3690         sets the LH of the tty's TTOALC word to 0, and sends
3691         a %TDORS character to the tty.  The tty should respond by
3692         informing the system of the current cursor position and
3693         setting the LH of TTOALC to -1.  Physical ttys must
3694         use the intelligent terminal protocol to do that,
3695         but STY users may do it with SCPOS.
3696 \f
3697 SDMPBT: set dump bit
3698
3699         arg 1   Disk channel number or <JOBDEV>
3700         arg 2   A word with the new value for the dump check
3701                 bit in bit 1.1.
3702
3703         The dump check bit is used by the magtape file backup
3704         system to keep track of which files have been backed
3705         up on magtape.  This bit therefore should not be
3706         twiddled light-heartedly.  The "!" you sometimes see
3707         in front of a date in a disk file directory is present
3708         iff the dump check bit for the file is zero.
3709
3710         See also the .DMPCH uuo and the RDMPBT
3711         symbolic system call.
3712 \f
3713 SETIOC: set input/output channel error
3714
3715         This symbolic system call is ARCHAIC and OBSOLETE.
3716         It is documented here for historical purposes only.
3717         Its use in new programs is to be avoided.
3718         Its function has been superseded by the JOBIOC
3719         symbolic system call.
3720
3721         arg 1   BOJ channel number or <JOBDEV>
3722         arg 2   IOC error code.
3723
3724         This is used by JOB devices to cause the calling job
3725         to receive a word 1 IOC interrupt.  This interrupt
3726         will be given when the calling job next attempts
3727         an IOT operation.  The .BCHN variable for that job
3728         will be set to the channel it has the JOB device 
3729         pen on, and bits 4.1-4.5 of the corresponding
3730         .IOS word are set to the specified IOC error code.
3731         See also the JOBINT symbolic system call.
3732
3733         Valid IOC error codes are as follows:
3734           1     ILLEGAL HARDWARE OPERATION ATTEMPTED
3735           2     ATTEMPTED RANDOM ACCESS TO ADDRESS BEYOND END OF FILE
3736           3     NON-RECOVERABLE DATA ERROR
3737           4     NON-EXISTENT SUB-DEVICE
3738           5     OVER IOPOP
3739           6     OVER IOPUSH
3740           7     USR OP CHNL DOES NOT HAVE USR OPEN
3741          10     CHNL NOT OPEN
3742          11     DEVICE FULL (can also mean a directory is full)
3743          12     CHNL IN ILLEGAL MODE ON IOT
3744          13     ILLEGAL CHR AFTER CNTRL P ON TTY DISPLAY
3745          14     DIRECTORY FULL
3746          15     DIRECTORY'S ALLOCATION EXHAUSTED
3747
3748 Errors:
3749
3750  33     MEANINGLESS ARGS
3751         Second argument is not a valid IOC error code.
3752  34     WRONG TYPE DEVICE
3753         First argument is not a BOJ channel number.
3754  41     OTHER END OF PIPELINE GONE OR NOT OPEN
3755 \f
3756 SFDATE: set file creation date
3757
3758         arg 1   Disk channel number or <JOBDEV>
3759         arg 2   New creation date and time in disk format:
3760                 4.7-4.1 Year (mod 100.).
3761                 3.9-3.6 Month (January = 1).
3762                 3.5-3.1 Day of month.
3763                 2.9-1.1 Time of creation, in half-seconds
3764                         after midnight.
3765
3766         See also the DSKUPD, FILBLK, RFDATE, RQDATE and SRDATE
3767         symbolic system calls.
3768 \f
3769 SIOT:   byte-string in/out transfer
3770
3771         cbits   Same as for IOT symbolic system call (q.v.).
3772         arg 1   I/O channel number.
3773         arg 2   Byte pointer to string to transfer
3774                 (must not be indexed or indirect).
3775         arg 3   Count of bytes to be transferred.
3776         arg 4   (Optional) device-independent special mode bits.
3777
3778         The second and third arguments are updated as the
3779         transfer proceeds.  If an end of file condition occurs
3780         or the job is interrupted out of the system call, they
3781         may not be fully counted out.
3782
3783         SIOT is notably efficient for STY input and TTY superimage
3784         output - much faster than block mode.  For details of Chaosnet
3785         SIOT, see the description of IOT.
3786
3787         Supposedly some esoteric devices don't support this mode of
3788         I/O transfer, but I can't think of any.  Also, it is alleged
3789         that on some devices, SIOT is not yet as efficient as block
3790         mode.
3791
3792 Errors:
3793
3794  12     MODE NOT AVAILABLE
3795         The device open on this channel doesn't support SIOT.
3796  14     BAD CHANNEL NUMBER
3797  33     MEANINGLESS ARGS
3798         The second or third argument was immediate.
3799 \f
3800 SOPEN: open file, using strings to specify the filename
3801
3802         arg 1   mode bits,,channel number
3803         arg 2   byte pointer to ASCIZ filename string,
3804                  or AOBJN pointer to a block of byte pointers
3805                  to strings to be concatenated.
3806
3807 If the second argument's left half is between -63. and -1, then the
3808 argument is treated as an AOBJN pointer to a block of byte pointers to
3809 ASCIZ strings.  Those ASCIZ strings are effectively concatenated for
3810 parsing.  Otherwise, the second argument is treated as one byte
3811 pointer.  0 may be used as the left half of a byte pointer, and is an
3812 abbreviation for 440700.
3813
3814 The combined string is parsed using the ordinary ITS filename syntax, with
3815 colon indicating a device name, semicolon indicating a directory name, and
3816 space separating filenames.  ^Q is used for quoting colon, semicolon,
3817 space, ^Q and ^@ (which would otherwise terminate the string); it cannot
3818 hurt to quote other characters with ^Q.  SOPEN defaults the device to
3819 "DSK", the second filename to ">", and the directory to the executing job's
3820 current sname.
3821
3822 Multiple devices, directories and names may be significant with some job
3823 devices, and perhaps with disk files as well at some time in the future.
3824
3825 Once the string has been parsed into filenames, operation proceeds as
3826 for the OPEN symbolic system call, which see.
3827
3828 SOPEN appears to a job device handler just like any other OPEN, except
3829 that the original second argument byte or AOBJN pointer is available
3830 as one of the values of the JOBCAL symbolic system call (which see).
3831 For an ordinary OPEN, that value from JOBCAL is zero.
3832 \f
3833 SRDATE: set file reference date
3834
3835         arg 1   Disk channel number or <JOBDEV>
3836         arg 2   New reference date in disk format:
3837                 4.7-4.1 Year (mod 100.).
3838                 3.9-3.6 Month (January = 1).
3839                 3.5-3.1 Day of month.
3840
3841         See also the DSKUPD, FILBLK, RESRDT, and RQDATE
3842         symbolic system calls.
3843 \f
3844 SREAPB: set the do not reap bit
3845
3846         arg 1   Disk channel or <JOBDEV>
3847         arg 2   0 for the normal case.
3848                 1 to request the grim file reaper to
3849                 leave this file alone.
3850
3851         The do not reap bit of the file open on the channel
3852         is set.  The G*** F*** R**P** doesn't
3853         respect this bit yet.
3854
3855         The bit can be read using the FILBLK system call.
3856         It is UNREAP in the FSDEFS insert file.
3857 \f
3858 SSERVE: set server job
3859
3860         arg 1   <JOB>   Client job  (OPTIONAL)
3861                 If omitted, self is assumed.
3862         arg 2   <JOB>   Server job
3863
3864         The .SERVER variable of the client job is modified to point to the
3865         server job.  See the description of .SERVER in .INFO.;ITS USETS.
3866         This system call permits .SERVER to be updated without trafficking
3867         in user indices.
3868
3869 Errors:
3870
3871  34     WRONG TYPE DEVICE
3872         Neither the client nor the server can be the PDP6
3873  31     CAN'T MODIFY JOB
3874         Executing job must be able to modify the client job.
3875 \f
3876 SSTATU: get various system status variables
3877
3878         val 1   If non-negative, the time (in thirtieths of a
3879                 second) until the system will go down.
3880                 -1 if the system does not intend to go down.
3881                 -2 if the system is already down (can happen
3882                 in a job with %OPLIV set).
3883                 Obtained from the ITS variable SHUTDN.
3884                 See the .DIETIME, .SHUTDN, and .REVIVE uuos.
3885         val 2   Non-zero if the system is being debugged.
3886                 This state causes the message
3887                         XX ITS ### BEING DEBUGGED
3888                 to appear on free consoles instead of the
3889                         XX ITS ### IN OPERATION
3890                 message usually seen when the system comes up.
3891                 If negative, the system is officially down;
3892                 ^Z is accepted only from tty 0 (the terminal
3893                 physically next to the PDP-10 console) or from
3894                 the tty whose number is the absolute value of
3895                 the contents of this quantity.  A ^Z is also
3896                 accepted from a tty associated with a STY;
3897                 this is so that STY devices may be debugged!
3898                 It is the responsibility of the STELNT server
3899                 to examine this quantity and keep network users
3900                 from logging in when the system is being debugged.
3901                 Obtained from the ITS variable SYSDBG.
3902         val 3   Number of users on the system.  This is a
3903                 count of logged-in, console-controlled job
3904                 trees in the system.  This variable is
3905                 incremented whenever a user logs in from a
3906                 console, and decremented whenever a console-
3907                 controlled tree is detached, gunned, or logged out.
3908                 This is the ITS variable SUSRS.
3909         val 4   Sum of parity and nxm memory errors during this
3910                 incarnation of the system.  This is the sum of
3911                 the ITS variables PARERR and NXMERR.
3912         val 5   Time the system has been up, in thirtieths of
3913                 a second.  This is the ITS variable TIME.
3914                 See the .RDTIME uuo.
3915         val 6   The left-justified name of the machine, i.e. one of:
3916                         SIXBIT \AI\     ;A.I. Lab KS-10
3917                         SIXBIT \ML\     ;Mathlab KS-10
3918                         SIXBIT \MC\     ;Mail Computer KS-10
3919                         SIXBIT \MD\     ;Mostly Development KS-10
3920                         SIXBIT \MX\     ;Macsyma Consortium KL-10
3921                         SIXBIT \SI\     ;Stacken ITS KS-10
3922                         SIXBIT \PM\     ;PandaMonium KS-10
3923                         SIXBIT \FU\     ;Australian KS-10
3924                         SIXBIT \DM\     ;Dynamic Modeling KA-10 (R.I.P.)
3925                         SIXBIT \MLKA\   ;Mathlab KA-10 (R.I.P.)
3926                         SIXBIT \AIKA\   ;A.I. Lab KA-10 (R.I.P.?)
3927                 This is the name which appears for XX in such
3928                 messages as
3929                         XX ITS ### IN OPERATION
3930                 and which serves as a device name for that
3931                 machine's disks (i.e. the ML device is the
3932                 DSK device of the ML (Mathlab) machine).
3933                 If more ITS machines come into existence,
3934                 naturally more machine names will be invented.
3935         val 7   The system version number, in sixbit.  This is
3936                 the ### in such messages as above.
3937         val 8   The number of free job slots.
3938
3939         DDT uses much of this information to print out its
3940         greeting to you:
3941         If value 2 is non-zero DDT prints out
3942                 ITS BEING DEBUGGED!
3943         If value 1 is non-negative DDT prints out
3944                 XX ITS GOING DOWN IN 1:23
3945         if e.g. ITS were going down in 1 minute, 23 seconds.
3946         (DDT also prints the contents of the file SYS:DOWN MAIL
3947         if that file exists.)
3948         Value 3 is used to print out the number of users as
3949                 23. LUSERS
3950         (if your DDT has not logged in itself, it increments
3951         this value so as to count you also).
3952         Values 4 and 5 are used to compute the number of memory
3953         errors per hour, printed as:
3954                 MEM ERRS .034142/HOUR
3955         The DDT command :SSTATU will print out all
3956         this information.
3957 \f
3958 STATUS: get input/output status word
3959
3960         arg 1   Channel number.
3961         val 1   Status word for specified channel.
3962
3963         This call returns a word describing the state of
3964         the specified channel:
3965         4.9-4.6 Always zero.  See the .IOPUSH and .IOPOP
3966                 uuo's, and the .IOP and .IOS user variables.
3967         4.5-4.1 If non-zero, the number of a non-display
3968                 input/output error (see table below).
3969         3.9-3.7 If non-zero, the number of an interpreted
3970                 display input/output error (see table below).
3971         3.6-3.1 If non-zero, the number of a standard error.
3972                 These are the same as the error codes returned
3973                 by failing .CALL's.
3974         2.9-2.3 Device dependent (see below).
3975         2.2     Buffering capacity empty.
3976         2.1     Buffering capacity full.
3977         1.9-1.7 Mode in which device was opened.
3978                 1.9     0 = ascii, 1 = image.
3979                 1.8     0 = unit, 1 = block.
3980                 1.7     0 = input, 1 = output.
3981         1.6-1.1 ITS internal physical device code.
3982                  0      TTY     Console input.
3983                  1      TTY     Printing console output.
3984                  2      TTY     Display console output.
3985                  3      LPT     Data Products line printer.
3986                  4      VID     Vidisector ???
3987                  5      BAT     Vidisector ???
3988                  6      PLT     Calcomp plotter.
3989                  7      PTP     Paper tape punch.
3990                 10      IMX     Input multiplexor.
3991                 11      OMX     Output multiplexor.
3992                 12      PTR     Paper tape reader.
3993                 13      DIS     DEC 340 display, ascii output.
3994                 14      IDS     Interpreted 340 display.        ???
3995                 15      MTn     Magnetic tape.
3996                 16      COD     Morse code device.
3997                 17      TAB     Tablet. ???
3998                 21      NUL     Source of zeroes, or output sink.
3999                 22      JOB     Job device.
4000                 23      BOJ     Inverse of JOB.
4001                 24      SPY     Spy on another console.
4002                 25      STY     Pseudo-teletype.
4003                 26      NET     ARPAnet (NCP).
4004                 27      LPT     Vogue line printer (yech!)
4005                 30      STK     Stanford keyboard.
4006                 31      MSP     (DM) Interprocess message protocol.
4007                 32      CHAOS   CHAOS net.
4008                 33      TCP     TCP Internet.
4009                 34      TRAP    Trap "device"
4010                 35      IPQ     Internet IP Queue.
4011                 36      UBI     KS10 Unibus interrupt
4012                 41      UTn     Microtape (DECtape).
4013                 43      DSK     2311 disk drives or equivalent.
4014                 60      USR     A not immediately inferior procedure.
4015                 61      USR     An immediately inferior procedure.
4016                 62      CLx     Various core link devices (CLA, CLI, CLO, CLU)
4017                 63      ---     File directory or ERR device.
4018                 64      USR     The PDP-6.
4019                 65      DIRHNG  Directory hang "device"
4020                 66      LOCK    Lock "device"
4021
4022         Device dependent bits for TTY input:
4023         2.9     Local tty.
4024         2.8     Next to the 340 or a 340 slave.
4025         2.5     Chars pending which have been .ITYIC'ed but not IOT'ed.
4026         2.4     The job possesses the tty.
4027
4028         Device dependent bits for TTY output:
4029         2.4     The job possesses the tty.
4030
4031         Device dependent bits for Data Products LPT:
4032         2.9-2.3 Current column (left margin = 0).
4033
4034         Device dependent bits for MTn (macro-tape):
4035         2.9     Chunk, write EOR after each IOT (should be block) on output,
4036                         don't ignore them on input.   See magtap info.
4037         2.8     0 => odd parity, 1 => even parity.
4038         2.7-2.6 Density: 00 => 800, 01 => 200, 10 => 556.
4039                 Apparently 11 => IBM 9 track 800 bpi??
4040         2.5     0 => 7 track, 1 => 9 track.
4041         2.4     End of tape.
4042         2.3     Read compare error.
4043
4044         Device dependent bits for NET:
4045         2.9-2.4 Socket state:
4046                 0       %NSCLS  CLS received or net down.  Connection closed.
4047                 1       %NSLSN  Listening for RFC.
4048                 2       %NSRFC  RFC received while listening.
4049                 3       %NSRCL  CLS received while in state 2.
4050                 4       %NSRFS  RFC sent.
4051                 5       %NSOPN  Connection open.
4052                 6       %NSRFN  RFNM wait on write link.
4053                 7       %NSCLW  CLS sent; waiting for matching CLS.
4054                 10      %NSCLI  CLS received but input still available.
4055                 11      %NSINP  Input available.
4056
4057         Device dependent bits for TCP:
4058         2.9-2.4 Connection state - see WHYINT call for state codes.
4059
4060         CHAOSnet provides no device dependent bits.
4061
4062         A STATUS word can be supplied to the ERR
4063         device to obtain corresponding error message, if any.
4064
4065         See also the JOBSTS symbolic system call, the .STATUS uuo,
4066         and the .IOS user variable.
4067 \f
4068 STDMST: set demon status
4069
4070         arg 1   Either the sixbit name or the user index
4071                 of a demon job.
4072         arg 2   If negative, flush all requests for the specified demon.
4073                 Otherwise:
4074                 4.9-3.1 If non-zero, the time in two-minute ticks
4075                         between automatic signals for the demon.
4076                 2.9-1.1 Number of requests pending for the demon.
4077         arg 3   Time in two-minute ticks until the next automatic
4078                 signal will occur (meaningful only if arg 2 bits
4079                 4.9-3.1 not zero).
4080
4081         See also the DEMSIG and RDDMST symbolic system calls,
4082         and the .DEMON uuo.
4083 \f
4084 STLGET: get information from Server Telnet
4085
4086         arg 1   a <TTY>
4087
4088         val 1   XJNAME of server telnet
4089         val 2   TRMNAM of server telnet
4090                 This is the sixbit name of the host connected to.
4091         val 3   SNAME of server telnet
4092         val 4   In LH: STY status bits
4093                 In RH: index of telnet server job which owns the STY.
4094
4095         This call can be used to find out where in the network
4096         a TTY really is.
4097
4098         The STY status bits are from the STYSTS table in ITS.
4099         Some of the more interesting ones include:
4100         %SSNET==4000    ;4.3 = 1 => THIS STY CONNECTED TO SOME NET SOCKETS.
4101         %SSCHA==2000    ;4.2 = 0 FOR ARPANET, 1 FOR CHAOS NET
4102         %SSTCP==1000    ;4.1 = 1 for TCP internet (%SSCHA must be 0)
4103
4104 Errors:
4105
4106 34      WRONG TYPE DEVICE
4107         Specified TTY is not controlled by a server telnet.
4108 \f
4109 STYGET: get information about STY
4110
4111         arg 1   <TTY>  (need not be associated with a STY)
4112         val 1   STY status word:
4113                 4.9     %SSHNG  Don't hang on input IOT.
4114                 4.8     %SSUSE  STY is in use.
4115                 4.7     %SSINT  Have given interrupt on STY output channels.
4116                 4.6     %SSONT  Have given interrupt on STY input channels.
4117                 4.5     %SSOHG  Don't hang on output IOT.
4118                 4.4     %SSORS  Give a %TDORS whenever an output RESET is
4119                                 done on the controlled tty, regardless
4120                                 of whether the tty is a software tty.
4121                 2.9-1.1 User index of job which owns the STY.
4122                 Zero if STY is not in use, or if TTY is not
4123                 associated with a STY.
4124         val 2   User index of job which owns the TTY, either as a device
4125                 or as a currently possessed console; or -1 if TTY is free.
4126         val 3   -1 if the TTY is not a console or is free.  Otherwise,
4127                 2.9-1.1 is the user index of the top-level job of the
4128                 job tree controlled by the TTY.
4129                 4.8 = 1 if that job is in the process of logging out.
4130                 4.7 = 1 if that job is logged in.
4131
4132         val 4   4.9     Owner of TTY is in a TTY output wait on the TTY.
4133                 1.1     Owner of TTY is in a TTY input wait on the TTY.
4134                 These bits probably don't work very well.
4135         val 5   4.9     TTY input available.
4136                 4.8     TTY output buffer has room.
4137         val 6   The tty's TTYSTA word.
4138                 4.9     %TACFM  TTY does not need a console free message
4139                                 eventually (hasn't been in use since
4140                                 the last one).
4141                 4.8     %TAC.Z  TTY is being ^Z'd.  Shouldn't be on with
4142                                 %TACFM.  If %TACFM and %TAC.Z are both 0,
4143                                 the tty is being freed and a console free
4144                                 message is immanent.
4145                 4.7     %TANJS  This ^Z is being flushed because no job
4146                                 slots are available.  If set, %TAC.Z
4147                                 will be 1 and %TACFM will be 0.
4148
4149         This symbolic system call originally was intended to return
4150         STY information, but now returns useful data concerning any TTY.
4151 \f
4152 STYNET: Connect a STY to a pair of Network connections.
4153
4154         arg 1   Sty channel (either direction).
4155         arg 2   -1 to disconnect the STY from its network channels
4156                 (in which case args 3 and 4 are unnecessary),
4157                 or Net input channel (to connect STY output to).
4158                 This may be a NCP, TCP, or CHAOS channel.
4159         arg 3   Net output channel (to connect STY input to).
4160         arg 4   Characters to send out on net
4161                 when an output .RESET is done on the STY's TTY.
4162                 Up to 3 8-bit characters, left-justified.
4163
4164         It is possible with this call to connect a STY to a pair
4165         of network channels, one open for input, and one open for output.
4166         When the direct connection is established, anything received by
4167         the net input socket will be fed automatically to the
4168         STY, and any type-out that the STY receives from its TTY will be
4169         fed automatically to the net output channel.  The transfer of
4170         data is handled by the system at clock level, eliminating
4171         the need for the program to wake up at each character.
4172
4173         Only one input and one output net channel can be connected to
4174         a STY, and only one STY can be connected to any net channel.
4175         Both sides of a STY are connected and disconnected at once.
4176         A job can connect a STY if it has the STY open in either direction
4177         (but it will generally want to have both directions open).
4178
4179         Once established, the direct connection will last until
4180         broken explicitly by the user, or until an escape condition
4181         is detected by the system.  Escape conditions include receipt
4182         of a TELNET control character on the net input channel (any
4183         character with the 200's bit on), and
4184         either net channel's getting into an abnormal state (other
4185         than %NSOPN, %NSINP, or %NSCLI) - in general, things which
4186         the system expects that the user program will want to take
4187         action on.  
4188
4189         The connection can be broken explicitly by the user either
4190         by a STYNET call with arg 2 negative, or by a CLOSE of any
4191         of the channels involved (this also happens when the job 
4192         is killed.)  It is an error to IOT on any of the channels
4193         without breaking the connection first.
4194
4195         The STYNET call returns immediately, without actually
4196         transferring any data.  The program can assume that the
4197         connection is still in effect until it is notified of
4198         a disconnection by an interrupt on the net input channel.
4199         While the connection lasts, interrupts on the net channels
4200         due to arriving data are intercepted by the system, so
4201         an interrupt implies that the connection has been broken.
4202
4203         When a %TDORS comes out of the STY, indicating that the TTY's
4204         output buffer has been cleared, this is indicated to the net
4205         output channel by means of a network interrupt (NCP only), and the
4206         string of up to 3 characters specified as the fourth argument
4207         to the STYNET call.  If TCP, these characters are PUSHed with the
4208         URGENT bit set.
4209
4210         If you use STYNET with the official TELNET protocol, you must
4211         turn on the %TPTEL bit in the STY TTY's TTYOPT variable, to
4212         cause the sequence CR-LF to be turned into just a CR.
4213
4214         For the Chaosnet:
4215         arg 1 - STY channel
4216         arg 2 - Chaos channel to connect to, or
4217                 -1 to disconnect
4218         arg 3 - Other Chaos channel (not actually used)
4219         arg 4 - Output-reset character sequence, up to 3 8-bit
4220                 characters left-justified.
4221
4222         This works the same as on the Arpanet.  The specified STY
4223         is connected to or disconnected from a Chaos net channel.
4224         Data is transferred in and out by the system without the
4225         need for intervention by the user program.  If an unusual
4226         condition occurs, the STY is disconnected from the Chaos
4227         channel and the user is interrupted.  It is illegal to do
4228         I/O on any of the involved channels while they are connected.
4229
4230         This call is provided for the benefit of the "Telnet" server.
4231
4232 Errors:
4233
4234  2      WRONG DIRECTION
4235         An input net channel was supplied as the third argument, or
4236         an output channel was supplied as the second argument.
4237  23     FILE LOCKED
4238         The STY or one of the network channels is already direct-connected
4239         to another network channel or another STY.
4240  41     OTHER END OF PIPELINE GONE OR NOT OPEN
4241         An attempt was made to disconnect a STY not already connected.
4242 \f
4243 T11MP:  PDP-10 to PDP-11 map
4244
4245         arg 1   Page number within the user's core.  That page
4246                 must be either non-existent or shared with an
4247                 absolute page.  The user's virtual page is made
4248                 to share with some arbitrarily chosen absolute
4249                 page, which is then made to share with PDP-11 memory
4250                 according to argument 2.
4251         arg 2   Desired PDP-10 to PDP-11 map word.
4252                 4.9     Valid (must be 1).
4253                 4.8     Write enable.
4254                 4.7-4.3 Unused.
4255                 4.2-3.9 PDP-11 number.  See below.
4256                 3.8-2.2 Relocation (origin of segment in PDP-11
4257                         address space).  <PDP-11 address> = 4*<relocation>.
4258                 2.1-1.1 Protection (number of accessible words - 1).
4259                         <PDP-11 protection> = 4*<protection>.
4260                         If protection=0 then only one 16-bit word
4261                         is accessible.
4262
4263         The CORBLK symbolic system call may be used in the special
4264         case of mapping one's TV console video buffer memory.
4265
4266         The AI KA-10 has a PDP-10 to PDP-11 interface which lets the PDP-10
4267         programmer directly access the memories of up to eight PDP-11's.
4268         PDP-10 pages are mapped into segments of variable size in the
4269         PDP-11's memory.  The PDP-10 to PDP-11 page map is also directly
4270         addressable in memory (it currently lives in absolute locations
4271         2,,776000 - 2,,776377).  There are 256. such entries, one for each
4272         page in the range 2,,0 - 2,,777777, which are the addresses fielded
4273         by the PDP-10 to PDP-11 interface.  ITS allocates these pages
4274         and their corresponding map entries randomly as needed.
4275
4276         When the PDP-10 attempts to access a physical address in the range
4277         2,,0 to 2,,777777, the interface uses the 776000 bits to index
4278         the map words.  If the appropriate map word does not have its
4279         valid bit set, the memory is considered non-existent.  The same
4280         is true if the reference would violate the protection bounds.
4281         The reference also fails if it is a write reference and the
4282         map word does not have the write enable bit set.
4283         Otherwise, the relocation quantity is added to the 1777 bits,
4284         and this determines which PDP-11 double-word to access.
4285         The PDP-11 number determines which PDP-11 to access, of course.
4286         The PDP-11 double-word corresponds to the high 32. bits of the
4287         PDP-10 word, as follows:
4288         PDP-10 BIT      PDP-11 WORD AND BIT
4289         4.9             0       15
4290         4.8             0       14
4291         4.7             0       13
4292         ---             ---     ---
4293         3.4             0       01
4294         3.3             0       00
4295         3.2             1       15
4296         3.1             1       14
4297         ---             ---     ---
4298         1.6             1       01
4299         1.5             1       00
4300         When reading the PDP-11 memory, bits 1.4-1.1 are read as zeros.
4301         When writing, 1.4=1 means don't change word 0, 1.3=1 means don't
4302         change word 1, and 1.2-1.1 are ignored.  Split cycles do the right
4303         thing, so ILDB and IDPB should work correctly.
4304         Note that accessing consecutive 16.-bit PDP-10 bytes will access
4305         consecutive PDP-11 words, but accessing consecutive 8-bit PDP-10
4306         bytes will not access consecutive PDP-11 bytes!  Rather, the PDP-11
4307         bytes are accessed in the order 1, 0, 3, 2.
4308
4309         The following PDP11s are currently (4/2/76) attached.
4310
4311                 0       The pdp11 that runs the AI KA-10 TV system.
4312                 1       The pdp11 that runs the AI KA-10 XGP.
4313                 2       The Lisp Machine GT40.
4314                 3       The Chess Machine (not really a pdp11.)
4315                 4       The Logo pdp11/45.
4316                 5       The Micro-Automation pdp11/45.
4317
4318 Errors:
4319
4320   1     NO SUCH DEVICE
4321         There is no PDP-11 connected to this PDP-10.
4322   3     DEVICE NOT READY
4323         The PDP-11 is not ready.
4324  33     MEANINGLESS ARGS
4325         The page number is invalid, or the map word has bit 4.9=0.
4326  37     NO CORE AVAILABLE
4327         No map words free.
4328 \f
4329 TCPOPN: open a TCP Internet connection          (TCP;TCPDOC >)
4330
4331         arg 1 - receive channel number
4332         arg 2 - transmit channel number
4333         arg 3 - local port #    (-1 to gensym a unique local port #)
4334         arg 4 - foreign port #  (-1 for wild port)
4335         arg 5 - foreign host address (HOSTS3 fmt) (-1 for wild host)
4336         arg 6 - Retransmission timeout (optional, not yet used)
4337
4338 Control bits:
4339         - None needed for channels - they are opened as .UAI and .UAO
4340                 automatically (no other modes possible).
4341         - 7 vs 8 bit ASCII transfers can be determined by user-space byte
4342                 pointer used in SIOT.  System buffers are always 8-bit bytes.
4343         %NOLSN - Listen mode
4344
4345         Note a value of -1 for either the foreign port or host will imply
4346         that the call is a "listen".  Return is always immediate, use NETBLK
4347         to determine when the channels become open.  For a non-listen call,
4348         there is an internal ITS timeout, but for listen the state can persist
4349         forever.
4350
4351 ERRORS:
4352   6     - No free TCBs or buffers available (system has too many active conns)
4353   7     - TCP disabled in system.
4354  11     - Bad local or fgn port #
4355  13     - Connection already exists with these ports
4356  14     - Bad channel # arguments.
4357  33     - Illegal to use same channel for both input/output.
4358 \f
4359 TRANAD: add a translation entry                                 (ITS TRANSL)
4360
4361         cbits   2.9     Atomic translation (do not retranslate).
4362                 2.8     0 => TRNLST, 1 => TRNLS1.
4363                         The TRNLST applies only to the specified job;
4364                         the TRNLS1 applies to the job and its inferiors,
4365                         direct or indirect.
4366                 1.2     Output translation.
4367                 1.1     Input translation.
4368                 Before the control bits are interpreted, the LH
4369                 of arg 1 is XOR'd into them.
4370         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4371         arg 2   AOBJN pointer to a block of "from" names.
4372         arg 3   AOBJN pointer to a block of "new" names.
4373
4374         Each AOBJN pointer should point to a block of
4375         from one to four words.  These are, in order, the
4376         device, file name 1, file name 2, and sname which
4377         are to be translated.  All names are left-justified
4378         within a word.  A zero or omitted word is equivalent
4379         to *.
4380         Before creating the translation, a TRANDL is
4381         performed on the first two arguments to prevent
4382         duplicate translations.
4383
4384         Uuos and symbolic system calls affected by translation
4385         include .FDELE, .OPEN, MLINK, RENAME, and OPEN.
4386
4387 Errors:
4388
4389   5     DIRECTORY FULL
4390         No room in system for new translation entry.
4391  14     BAD CHANNEL NUMBER
4392  31     CAN'T MODIFY JOB
4393  33     MEANINGLESS ARGS
4394  34     WRONG TYPE DEVICE
4395         Not meaningful to put a translation on the PDP-6.
4396  35     NO SUCH JOB
4397 \f
4398 TRANCL: clear translation list  (delete all entries)            (ITS TRANSL)
4399
4400         cbits   2.8     Clear TRNLS1.
4401                 2.7     Clear TRNLST.
4402                 The TRNLST applies only to the
4403                 specified job;  the TRNLS1 applies
4404                 to the job and its inferiors,
4405                 direct or indirect.
4406                 Before the control bits are interpreted, the LH
4407                 of arg 1 is XOR'd into them.
4408         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4409
4410
4411         Either or both lists may be cleared with a single call.
4412 Errors:
4413
4414  14     BAD CHANNEL NUMBER
4415  31     CAN'T MODIFY JOB
4416  33     MEANINGLESS ARGS
4417  34     WRONG TYPE DEVICE
4418         Not meaningful to clear translation lists for PDP-6.
4419  35     NO SUCH JOB
4420 \f
4421 TRANDL: delete a translation entry                              (ITS TRANSL)
4422
4423         cbits   2.8     0 means TRNLST, 1 means TRNLS1.
4424                         The TRNLST applies only to the
4425                         specified job;  the TRNLS1 applies
4426                         to the job and its inferiors,
4427                         direct or indirect.
4428                 1.2     Stop translating for output.
4429                 1.1     Stop translating for input.
4430                 Before the control bits are interpreted, the LH
4431                 of arg 1 is XOR'd into them.
4432         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4433         arg 2   An AOBJN pointer to a block of names.
4434
4435         The AOBJN pointer should point to a block of
4436         from one to four words.  These are, in order, the
4437         device, file name 1, file name 2, and sname which
4438         are no longer to be translated.  All names are
4439         left-justified within a word.  A zero or omitted
4440         word is equivalent to *.
4441
4442 Errors:
4443
4444   4     FILE NOT FOUND
4445         No such translation entry to delete.
4446  14     BAD CHANNEL NUMBER
4447  31     CAN'T MODIFY JOB
4448  33     MEANINGLESS ARGS
4449  34     WRONG TYPE DEVICE
4450         Not meaningful to delete translation entry for PDP-6.
4451  35     NO SUCH JOB
4452 \f
4453 TRANEX: examine a translation list                              (ITS TRANSL)
4454
4455         cbits   2.8     0 means TRNLST, 1 means TRNLS1.
4456                         The TRNLST applies only to the
4457                         specified job;  the TRNLS1 applies
4458                         to the job and its inferiors,
4459                         direct or indirect.
4460                 Before the control bits are interpreted, the LH
4461                 of arg 1 is XOR'd into them.
4462         arg 1   RH is a <JOB>.  LH XOR'd into cbits.
4463         arg 2   AOBJN pointer to array in core.
4464         val 1   AOBJN pointer to tail end of array,
4465                 i.e. the part not needed to hold the data.
4466
4467         The translation list is stored as consecutive
4468         nine-word blocks of translation information.
4469         Each block has the following form:
4470                 wd 0    4.9     Atomic translation entry.
4471                         3.2     Output translation.
4472                         3.1     Input translation.
4473                 wd 1    "from" device name.
4474                 wd 2    "from" file name 1.
4475                 wd 3    "from" file name 2.
4476                 wd 4    "from" sname.
4477                 wd 5    "to" device name.
4478                 wd 6    "to" file name 1.
4479                 wd 7    "to" file name 2.
4480                 wd 8    "to" sname.
4481         A zero word for a "from" name means translate for any
4482         name in that position; a zero "to" word means don't
4483         change that name when translating.
4484
4485 Errors:
4486
4487  14     BAD CHANNEL NUMBER
4488  33     MEANINGLESS ARGS
4489  34     WRONG TYPE DEVICE
4490         Not meaningful to examine translation list for PDP-6.
4491  35     NO SUCH JOB
4492  37     NO CORE AVAILABLE
4493         Supplied array too small to hold data.
4494 \f
4495 TRANS:  translate some file names                               (ITS TRANSL)
4496
4497         cbits   1.1     0 for input, 1 for output.
4498         arg 1   "from" device name.
4499         arg 2   "from" file name 1 (defaults to zero).
4500         arg 3   "from" file name 2 (defaults to zero).
4501         arg 4   "from" sname (defaults to job's current sname).
4502         arg 5   mode (XOR'd with control bits; defaults to 0).
4503         val 1   "to" device name.
4504         val 2   "to" file name 1.
4505         val 3   "to" file name 2.
4506         val 4   "to" sname.
4507
4508         The given file names are translated by the same rules
4509         for translation governing the operations of OPEN,
4510         RENAME, DELETE, and MLINK.  These rules are as follows.
4511
4512         Translation lists are searched in the order:
4513                 executing job's TRNLST
4514                 executing job's TRNLS1
4515                 executing job's superior's TRNLS1
4516                 that job's superior's TRNLS1
4517                 . . .
4518                 top-level job's TRNLS1
4519                 system job's TRNLS1
4520         The lists are searched for an entry matching the given "from"
4521         file names.  A translation entry is said to match if each
4522         "from" name matches the entry's corresponding name,
4523         and if the translation entry applies to the mode (input or output).
4524         A name in turn matches if the entry's name is the same as
4525         the given name, or if the entry's name is * (matches anything).
4526         If a match is found, the given file names are replaced by the "to"
4527         file names in the translation entry, except that in the entry
4528         a "to" file name of * means don't change the given name;
4529         the process is then repeated from the beginning unless the
4530         matching translation entry is atomic.  When this happens, or
4531         when a full search finds no matching translation entries,
4532         the translation process is complete.  To prevent endless
4533         retranslation, it is considered an error to repeat the
4534         translation process more than eight times.
4535
4536         When a job is first created its TRNLST and TRNLS1 are null.
4537         The TRANAD, TRANCL, TRANDL, and TRANEX symbolic system calls
4538         may be used to examine and modify translation lists.
4539
4540 Errors:
4541
4542   3     TOO MANY TRANSLATIONS
4543         No more than eight consecutive translations are permitted.
4544 \f
4545 TRPOPN: Open trap-device channel
4546
4547         arg 1   <JOB>
4548         arg 2   channel number in that job
4549         arg 3   IOCHNM word (only LH is used)
4550         arg 4   IOCHST word
4551
4552         The specified channel of the specified job is made a trap-device
4553         channel.  Almost any attempt to use it will cause a %PITRP interrupt.
4554         See documentation of the TRAP: device.
4555
4556 Errors:
4557
4558 13      FILE ALREADY EXISTS
4559         The specified channel is open.
4560
4561 14      BAD CHANNEL NUMBER
4562         arg 2 is invalid.
4563
4564 31      CAN'T MODIFY JOB
4565         The <JOB> is not clobberable.
4566
4567 34      WRONG TYPE DEVICE
4568         The <JOB> is the pdp-6.
4569 \f
4570 TTYESC: simulate type-in of ^_
4571
4572         arg 1   <TTY>
4573
4574         Pretends that the user has just typed in a ^_.
4575         The next character the user types will be interpreted
4576         as a ^_ command.
4577
4578         The intended use of this is for programs which use
4579         super-image input, so that ^_ does not have its normal
4580         effect, but which wish to provide an escape convention
4581         so that the effect of ^_ can be obtained.  When the program
4582         sees the escape character sequence as input, it should
4583         do a TTYESC.
4584
4585 Errors:
4586
4587 7       DEVICE NOT READY
4588         The terminal is already in the middle of a ^_ code
4589         being typed by the user.
4590 \f
4591 TTYFLS: flush TTY input
4592
4593         arg 1   <TTY>
4594         control bits:
4595         1.1     0 => cause the last interrupt character .ITYIC'ed
4596                      to be ignored by .IOT.
4597                 1 => discard all input up to and including the last
4598                      character .ITYIC'ed.
4599
4600         This call is normally used by TTY input interrupt handlers.
4601 \f
4602 TTYGET: read the variables TTYST1, TTYST2, TTYSTS               (ITS TTY)
4603
4604         arg 1   <TTY> or <JOBDEV>
4605         val 1   TTYST1 variable.
4606                 This variable contains six groups of six bits.
4607                 Each group is as follows:
4608                 1.6     %TGMPE  Echo at main program level (when IOT'ed).
4609                 1.5     %TGPIE  Echo at interrupt level (when typed).
4610                 1.4     %TGIMG  Echo in image mode.
4611                 1.3     %TGSPC  Special hack: convert lower case to upper.
4612                 1.2     %TGACT  Activation character.
4613                 1.1     %TGINT  Interrupt character.
4614                 The character groups are:
4615                 4.9-4.4         ^@-^F ^K ^L ^N-^R ^T-^Z ^\-^_
4616                 4.3-3.7         Upper and lower case letters.
4617                 3.6-3.1         Digits.
4618                 2.9-2.4         ! " # $ % & ' , . : ; ? @ \ ` | ~
4619                 2.3-1.7         + * - / = ^ _
4620                 1.6-1.1         < > ( ) [ ] { }
4621         val 2   TTYST2 variable.
4622                 Six more groups of six bits:
4623                 4.9-4.4         ^G ^S
4624                 4.3-3.7         ^I ^J  (tab, linefeed)
4625                 3.6-3.1         altmode  (33)
4626                 2.9-2.4         ^M  (carriage return)
4627                 2.3-1.7         rubout  (177)
4628                 1.6-1.1         space, ^H  (backspace)
4629         val 3   TTYSTS variable.
4630                 4.9     %TSFRE  Free console (not in use).
4631                 4.8     %TSCLE  ^L should echo as "^L" (normally
4632                                 clears screen on displays).
4633                 4.7     %TSHDX  Same as %TOHDX.  Vestigial.
4634                 4.6     %TSFCO  Use full 12-bit TV char set for output and
4635                                 echoing: echo CONTROL as ALPHA, echo META
4636                                 as BETA, echo SUPER as EPSILON, and use
4637                                 Sail graphics if TOP is set.
4638                 4.5     %TSALT  Do not standardize altmodes.
4639                 4.4     %TSROL  Scroll mode.
4640                 4.3     %TSSAI  Echo and ascii output use SAIL
4641                                 character set.
4642                 4.2     %TSACT  Next input IOT shouldn't wait
4643                                 for an activation character.
4644                 4.1     %TSNEA  Don't echo in echo area; echo in M.P. Area.
4645                 3.9     %TSINT  Next input character should
4646                                 interrupt even if it ordinarily
4647                                 would not (%TGINT = 0).
4648                 3.8     %TSMOR  Inhibit **MORE** processing.
4649                 3.7     %TSATY  Set whenever an .ATTY executed by
4650                                 some superior returns the tty to
4651                                 the job.
4652                 3.4     %TSNOE  Defer echoing.
4653                 3.3     %TSLCZ  Last character typed was ^Z.
4654                                 This bit causes .ATTY's to fail.
4655                 3.2     %TSSII  Super-image input.  The special
4656                                 actions of ^Z and ^_ are suppressed.
4657                 3.1     %TSCNS  This is a console, not a device.
4658                 2.9-1.1 The user index of the job which controls
4659                         the tty, or -1 if the tty is free.
4660         val 4   the TTYTYP variable
4661                 See the CNSGET documentation.
4662         val 5   the TCTYP variable
4663                 See the CNSGET documentation.
4664
4665         Values 4 and 5 probably should not be depended upon.
4666
4667         See also the CNSGET, CNSSET, and TTYSET symbolic system calls.
4668
4669 Errors:
4670
4671   1     NO SUCH DEVICE
4672         No tty exists with the specified number.
4673  14     BAD CHANNEL NUMBER
4674  34     WRONG TYPE DEVICE
4675 \f
4676 TTYSET: set the variables TTYST1, TTYST2, TTYSTS                (ITS TTY)
4677
4678         arg 1   <TTY> or <JOBDEV>
4679         arg 2   TTYST1 variable.  See under TTYGET.
4680         arg 3   TTYST2 variable.  See under TTYGET.
4681         arg 4   TTYSTS variable (optional).  See under TTYGET.
4682                 %TSFRE, %TSHDX, %TSLCZ, and %TSCNS may not be altered,
4683                 nor may the RH.
4684
4685         See also the CNSGET, CNSSET, and TTYGET symbolic system calls.
4686
4687 Errors:
4688
4689   1     NO SUCH DEVICE
4690         No tty exists with the specified number.
4691  14     BAD CHANNEL NUMBER
4692  34     WRONG TYPE DEVICE
4693 \f
4694 TTYVAR: read or set a variable associated with a TTY.
4695
4696         arg 1   <TTY> or <JOBDEV>
4697
4698         In the simplest mode:
4699
4700         arg 2   the name of a tty variable, in SIXBIT.
4701         arg 3   (if writing) the new value.
4702
4703         If arg 3 is not supplied, you are reading, and
4704         val 1   is the value of the variable.
4705
4706         In immediate-instruction mode:
4707
4708         arg 2   the SIXBIT name of a tty variable.
4709         arg 3   ignored
4710         arg 4   the instruction
4711
4712         This mode is detected by the presence of four arguments.
4713
4714         The specified instruction is executed as if the
4715         variable was in ac 0.  MOVE can be used to set the
4716         variable, MOVEM to read it, but you can also use
4717         TLO to set bits, ADDI to increment, etc.
4718
4719         In block mode
4720
4721         arg 2   an AOBJN pointer to a block of pairs of words.
4722
4723         This mode is detected by bits 4.1-4.9 of arg 2 being all
4724         ones.
4725
4726         The first word in each pair is the SIXBIT name of a tty
4727         variable, and the second word is an instruction to be
4728         executed as if that variable were in ac 0.  The block pointer
4729         argument is updated.
4730
4731         The TTY variables include HEIGHT, WIDTH, ISPEED, OSPEED, TTYOPT,
4732         TTYTYP, TTYCOM, TCTYP, TTYROL, TTYSMT, and IDLTIM.  See
4733         .INFO.;ITS TTY for a description of their meanings.
4734
4735         The instructions allowed in immediate-instruction and
4736         block modes are:  MOVx, MOVxI, MOVEM, ADD, ADDI, SUB, SUBI,
4737         all Booleans in normal and immediate modes, and TxZ, TxC,
4738         and TxO (i.e. all Test instructions that modify and don't
4739         skip.)
4740
4741 Errors:
4742
4743  11     ILLEGAL FILE NAME
4744         Unrecognized tty variable name.
4745  26     DEVICE WRITE-LOCKED
4746         Specified variable or specified tty cannot be written.
4747  33     MEANINGLESS ARGS
4748         Attempt to store an illegal value in the TCTYP variable,
4749         or an illegal instruction was specified in immediate-
4750         instruction or block mode.
4751 \f
4752 TVWHER: tell where a TV is
4753
4754         arg 1   <TTY> or <JOBDEV>
4755         val 1   The keyboard number of the physical
4756                 terminal in use.
4757                 The correspondence between keyboard numbers
4758                 and physical locations is in the file
4759                 SYSENG;TVKBD ROOMS, which is how the NAME
4760                 program gets this information.  If this table
4761                 and that file disagree, that file is correct,
4762                 and please update this table.
4763                 As of February 7, 1977, these correspondences
4764                 were in effect:
4765                 KBD #   ROOM    WHO LIVES THERE
4766                 0       809     Fahlman, Holloway, Knight x7807
4767                 1       810     Lavin, Kuipers, Miller, Bruss x7836 
4768                 2       919     Very Small Data Bases north x6765 
4769                 3       812     Yvonne, Karen x5876 
4770                 4       813     Hewitt x5873 
4771                 5       814     Sussman, McDermott x5874 
4772                 6       808     Freiling, Lozano-Perez, Ullman x5875 
4773                 10      817     Jabari x6218 
4774                 13      819     Goldstein x5879 
4775                 14      820     Minsky x5864 
4776                 17      822     Marr x2082 
4777                 21      824     Rich, Levin, DeKleer x6032 
4778                 22      825     Purcell, Doyle x5848 
4779                 23      826     Fredkin's Folly x5904
4780                 30      925     Moon (Tycho, north wall) x6765 
4781                 31      902     Mason, Raibert, Hollerbach x3483 
4782                 32      919     Very Small Data Bases south x6765 
4783                 33      344     Edwards, Lebel x6765 
4784                 34      913     Baisley, Greenblatt x6765 
4785                 35      914     Gosper's Fishbowl x2076 
4786                 36      912     9th Floor Lounge x6765 
4787                 37      907     Chess, Lisp Machines x6765 
4788
4789         val 2   The number of the TV video buffer in use
4790                 on this tty (0-17 octal).  This is NOT a
4791                 Video Switch input number.
4792
4793 Errors:
4794
4795   1     NO SUCH DEVICE
4796         No tty exists with the specified number.
4797  10     DEVICE NOT AVAILABLE
4798         The PDP-11 which services the TV consoles is down.
4799  34     WRONG TYPE DEVICE
4800         The specified tty was not a TV, or the specified
4801         channel was not a <TTY> or <JOBDEV>.
4802 \f
4803 UNLOCK: Unlock JOB's locks.
4804
4805         arg 1   <JOB>
4806
4807         If the specified job is writable, and is using the locks
4808         feature, its locks are unlocked.  (Usually this is used on
4809         onesself.)  See the ITS LOCKS file for more information
4810         on locks.
4811
4812         (Note that this has nothing to do with the LOCK device.  In
4813         particular it will -not- close LOCK device channels.)
4814
4815 Errors:
4816
4817  31     CAN'T MODIFY JOB
4818         The specified job is not writable.
4819
4820  Plus the usual errors for <JOB> arguments.
4821 \f
4822 USRMEM: Read or write another job's memory
4823
4824         cbits   2.9     Allow writing into any job
4825                 1.1     If page isn't readable or writable give an
4826                         MPV or pure interrupt to the job being
4827                         referenced.
4828
4829         arg 1   <JOB>
4830         Other args are like USRVAR and TTYVAR.  In place of
4831         a variable-specifier you put the address in the job
4832         of the word to be read or written.
4833
4834         arg 2   Address to read or write (non-negative)
4835
4836         Straight reading:
4837
4838         Specify only 2 arguments.
4839
4840         Straight writing:
4841
4842         arg 3   New value
4843
4844         Writing with an instruction:
4845
4846         arg 3   Ignored
4847         arg 4   Instruction to write with
4848
4849         Block mode:
4850
4851         arg 2   An AOBJN pointer to a block of pairs, first address
4852                 and then instruction.
4853
4854         val 1   Previous contents (these are not valid in block mode)
4855         val 2   New contents
4856
4857
4858         Reading:
4859                 The content of the specified address in <JOB>
4860                 is returned as val 1.
4861
4862         Writing:
4863                 Arg 3 is written into the specified address
4864                 in <JOB>.  The previous contents are returned
4865                 as val 1.
4866
4867         Writing with an instruction:
4868                 The instruction should modify its AC as if the spec'd job's
4869                 memory location were in it.  The memory operand is fetched
4870                 from your own address space and is not stored back.
4871                 No jobs can run while the location is being modified, that is
4872                 between the fetching of the old value and the storing of
4873                 the new value.
4874                 The previous contents are returned as val 1, the new
4875                 contents as val 2.
4876
4877 Errors:
4878
4879  31     CAN'T MODIFY JOB
4880         The specified job is not writable.
4881  32     CAN'T GET THAT ACCESS TO PAGE
4882         The specified page is either nonexistant
4883         or is read-only.
4884  33     MEANINGLESS ARGS
4885         Attempt to specify an illegal instruction for writing.
4886 \f
4887 USRVAR: Read or set some of a job's variables
4888
4889         arg 1   <JOB>
4890
4891         In the simplest mode:
4892
4893         arg 2   user variable specifier (see below).
4894         arg 3   (if writing) the new value.
4895
4896         If arg 3 is not supplied, you are reading, and
4897         val 1   is the value of the variable.
4898
4899         In immediate-instruction mode:
4900
4901         arg 2   user variable specifier (see below).
4902         arg 3   ignored
4903         arg 4   the instruction
4904
4905         This mode is detected by the presence of four arguments.
4906
4907         The specified instruction is executed as if the
4908         variable was in ac 0.  MOVE can be used to set the
4909         variable, MOVEM to read it, but you can also use
4910         TLO to set bits, ADDI to increment, etc.
4911
4912         In block mode
4913
4914         arg 2   an AOBJN pointer to a block of pairs of words.
4915
4916         This mode is detected by bits 4.1-4.9 of arg 2 being all
4917         ones.
4918
4919         The first word in each pair is the user variable specifier
4920         (see below), and the second word is an instruction to be
4921         executed as if that variable were in ac 0.  The block pointer
4922         argument is updated.
4923
4924         The instructions allowed in immediate-instruction and
4925         block modes are:  MOVx, MOVxI, MOVEM, ADD, ADDI, SUB, SUBI,
4926         all Booleans in normal and immediate modes, and TxZ, TxC,
4927         and TxO (i.e. all Test instructions that modify and don't
4928         skip.)
4929
4930         This call is the symbolic equivalent of the .USET and .SUSET
4931         UUO's.  It can read, write, or both (but you are usually not
4932         allowed to write any job except yourself or an inferior);
4933         it is a .SUSET if the <JOB> is %JSELF, or a .USET if given a
4934         channel number as the <JOB>, or it can be given other kinds
4935         of job specs.
4936
4937         The user variable specifier can be either numeric or sixbit.
4938         If sixbit, it is the same as the name given in the ITS USETS
4939         file except without the dot at the beginning.  Sixbit specifiers
4940         are good for programs which take arguments as to which user
4941         variable to operate on, and are useful to allow a program
4942         which uses a new variable to assemble before that variable is
4943         actually put in the system (it will get error code 11 when it
4944         tries to refer to the variable.)
4945
4946         A numeric specifier is a small integer similar to those used
4947         with the .USET and .USET uuos.  Predefined symbols exist for
4948         these, consisting of ".R" followed by the name of the variable.
4949         (Use ".R" rather than ".S" even if you are writing.)  Do not
4950         use the symbols without the "R" (these are something else.)
4951         The .IOC, .IOS, .IOP, and .PMAP arrays of user variables
4952         can only be specified numerically.
4953
4954         See the .SUSET and .USET UUO's (in .INFO.;ITS UUOS)
4955         for more information on particular user variables.
4956
4957 Errors:
4958
4959  11     ILLEGAL FILE NAME
4960         Unrecognized sixbit user variable specifier, or numeric specifier
4961         larger than the legal range.
4962  12     MODE NOT AVAILABLE
4963         The specified variable is not available for the current combination
4964         of reading versus writing and self versus other job.
4965  13     FILE ALREADY EXISTS
4966         Attempt to cause two jobs in the system to have the same UNAME/JNAME pair.
4967  31     CAN'T MODIFY JOB
4968         Attempt to write into a user variable of a job which is not writable.
4969  33     MEANINGLESS ARGS
4970         Attempt to specify an illegal instruction in immediate-
4971         instruction or block mode; or attempt to store an illegal value
4972         into a user variable (e.g. zero into the .UNAME).
4973  34     WRONG TYPE DEVICE
4974         Attempt to access user variables of the pdp-6 other than .UIND
4975         or .MEMT.
4976  40     NOT TOP LEVEL
4977         Attempt to set a user variable for a job that is not top level,
4978         when only top-level jobs are allowed to set that variable, for
4979         example the .UNAME and .JNAME.
4980 \f
4981 VIDBUF: request/release video buffer
4982
4983         arg 1   If non-negative, the number of a video buffer
4984                 to release.  If negative, requests a video buffer.
4985         val 1   If arg 1 was negative, the number of the buffer obtained.
4986
4987         A video buffer for the PDP-11 TV consoles is assigned or
4988         released.  If assigned, the video switch input number
4989         of that buffer is returned.  This value can be placed
4990         in bits 4.1-3.3 of the .TVCREG user variable in order to
4991         cause video buffer pages in one's page map to refer to
4992         the allocated video buffer.
4993
4994         A video buffer is a segment of PDP-11 memory large enough
4995         to represent all the bits on a TV display.  A display
4996         is 1100=576. bits wide by 706=454. lines high.  Every
4997         line is represented by 36. 16.-bit PDP-11 words;
4998         this corresponds to 18. PDP-10 words as mapped through
4999         the PDP-10 to PDP-11 interface (see the T11MP symbolic
5000         system call).  The word with the lowest address holds
5001         the leftmost displayed bits; furthermore within each word
5002         bit 15 is the leftmost displayed bit.  Thus, as seen by the
5003         PDP-10 bits are displayed in the "obvious" manner.
5004         The entire buffer is 16344.=37730 PDP-11 words long;
5005         this corresponds to 8172.=17754 PDP-10 words.
5006         The word 77777 PDP-11 words (17777 PDP-10 words) from the
5007         origin of the video buffer is a special control register:
5008         3.2-2.9 15-13   Unused.
5009         2.8     12      0 => white on black, 1 => black on white.
5010         2.7-1.5 11-00   Scroll offset: video buffer wraps around;
5011                         the first word displayed is that 4*<offset>
5012                         PDP-11 bytes from the buffer origin.  For
5013                         best results this should be a multiple
5014                         of 9 (for vertical scrolling).
5015         The PDP-11 always sees a video buffer as beginning at its
5016         location 60000 (byte address); which video buffer it is looking
5017         at is controlled by the console register at location 164044 octal.
5018         Thus the PDP-11 sees the scroll register as being at address
5019         157776 octal.
5020
5021         See also the VIDSW symbolic system call.
5022 Errors:
5023
5024   4     FILE NOT FOUND
5025         Attempt to release a buffer not assigned to the job.
5026   7     DEVICE NOT READY
5027         The PDP-11 is not ready.
5028  33     MEANINGLESS ARGS
5029         Arg 1 is non-negative but not a valid video buffer number.
5030 \f
5031 VIDSW:  set video switch
5032
5033         arg 1   Video switch input number.
5034         arg 2   Video switch output number.
5035
5036         The video switch is set up so that the specified video
5037         output will gobble bits from the specified video input.
5038
5039         As of July 25, 1975, the only video inputs are TV
5040         video buffers.  These correspond to Tnm device numbers
5041         as follows:
5042
5043         Tnm     Video Input Number
5044         T47     24              T47 is used for console free buffer.
5045         T52     1               When you type ESC<n>S, <n> is
5046         T53     2               the video input number.  The PDP-11
5047         T54     5               merely switches that input to your
5048         T55     6               TV display, which is a video output.
5049         T56     7
5050         T57     10
5051         T60     21
5052         T61     22
5053         T62     23
5054
5055         The possible video outputs are mostly TV displays, but also
5056         the Tektronix hard-copy device which sits next to the XGP.
5057         (The keyboard number may be relevant to use of the TVWHER
5058         symbolic system call.)  As of July 25, 1975:
5059
5060         Video Output    Keyboard        Location of TV
5061          0               0              809 Fahlman, Holloway, Knight
5062          1              14              820 Minsky
5063          2              21              824 Rich, McDonald, deKleer
5064          3               6              815 Freiling, Perez, Ullman
5065          4              10              817 Jabari
5066          5              22              825 Freuder, Grossman, Purcell
5067          6               4              813 Hewitt
5068          7               5              814 Brown, McDermott, Sussman
5069         10              13              819 Goldstein, Woods
5070         11              17              822 Marr, Sandewall
5071         12              35              915 Cohen, Gosper, etc.
5072         13              34              913 Baisley, Greenblatt
5073         14              33              334 Lebel
5074         15              30              925 Jarvis, Moon
5075         16              31              918 Freeman
5076         17              32              920 Computer room, near PDP-11
5077         20               3              812 Yvonne, Williams
5078         21              36              912 9th Floor Lounge
5079         22              37              914 Larson, Lebel, Mousouriss
5080         23              1               810 Kuipers
5081         27              Tektronix hard-copy output device.
5082
5083 Errors:
5084
5085   7     DEVICE NOT READY
5086         The PDP-11 is not ready.
5087 \f
5088 WHOLIN: examine and set TV who-line                             (ITS TV)
5089
5090         arg 1   <TTY> or <JOBDEV>
5091                 Must be a TV terminal if a <TTY>.
5092         arg 2   If present, used to set new who mode:
5093                 -1      No who-line.
5094                 0       User who-line; migrates with TTY.
5095                 1       User who-line; frozen on who job.
5096                 4       System who-line.
5097         arg 3   If present, used to set new who <JOB>.
5098         val 1   Old who mode.
5099         val 2   Old who job.
5100
5101         The TTY must be specified by a channel number and not
5102         by 400000 + tty number if the variables are to be altered.
5103
5104         See ITS TV.
5105
5106 Errors:
5107
5108   1     NO SUCH DEVICE
5109         No tty exists with the specified number.
5110  10     DEVICE NOT AVAILABLE
5111         The PDP-11 which services the TV consoles is down.
5112  34     WRONG TYPE DEVICE
5113         The specified tty was not a TV, or the specified
5114         channel was not a <TTY> or <JOBDEV>.
5115 \f
5116 WHYINT: Find out reason for second-word interrupt
5117
5118         arg 1   channel # (or <JOBDEV>)
5119
5120         val 1   %WY code (see below)
5121         val 2-n device-dependent
5122
5123         This system call is the standard response to a second-word
5124         (.IFPIR) interrupt.  The first value returned is a code
5125         number which indicates the type of device on the channel.
5126         Usually a program will know what type of device is present,
5127         because it only tries to use one type, but this value
5128         is provided just in case.  The codes are:
5129
5130                 1    %WYTYI     TTY input
5131                 2    %WYTYO     TTY output
5132                 3    %WYSTI     STY input
5133                 4    %WYSTO     STY output
5134                 5    %WYNET     (Arpa)NET
5135                 6    %WYCHA     CHAosnet
5136                 7    %WYTCP     TCP Internet
5137                 10   %WYUBI     KS10 Unibus interrupt (UBI device)
5138
5139         The device-dependent values returned are:
5140
5141         For a TTY input channel:
5142         val 1   %WYTYI
5143         val 2   character typed.  Reading characters this way
5144                 does not interfere with later reading them via
5145                 normal IOT.  This allows characters to be processed
5146                 both as interrupt characters at the time they are
5147                 typed, and as normal input.  The call fails to
5148                 skip if there are no more interrupt characters.
5149                 The program should keep calling WHYINT until
5150                 it fails to skip, then DISMIS the interrupt.
5151
5152         For a TTY output channel:
5153         val 1   %WYTYO
5154         val 2   bit mask of reasons.  The only reason that presently
5155                 exists is:
5156                         4.9     --MORE-- interrupt.  (Typeout reached
5157                                 the bottom of the screen.)
5158
5159         For a STY input channel:
5160         val 1   %WYSTI
5161
5162         For a STY output channel:
5163         val 1   %WYSTO
5164
5165         For a UBI channel:
5166         val 1   %WYUBI
5167         val 2   Count of all interrupts ever signalled at the
5168                 given interrupt address.
5169
5170         For a NET (Arpanet NCP) channel:
5171         val 1   %WYNET
5172         val 2   Sign bit 1 if "network interrupt" received.
5173                 Right Half Socket state:
5174                 0       %NSCLS  Connection closed.
5175                 1       %NSLSN  Listening for RFC.
5176                 2       %NSRFC  RFC received while listening.
5177                 3       %NSRCL  CLS received while in %NSRFC state.
5178                 4       %NSRFS  RFC sent.
5179                 5       %NSOPN  Connection open.
5180                 6       %NSRFN  RFNM wait on write link.
5181                 7       %NSCLW  CLS sent, waiting for matching CLS.
5182                 10      %NSCLI  CLS received but input still available.
5183                 11      %NSINP  Input available.
5184         val 3   Number of bytes of input available (if input channel).
5185                 Number of bytes free in output buffer (if output channel.)
5186         val 4   Close reason.  Only valid if val 2 is %NSCLS.
5187                 0       %NCNTO  Never opened.
5188                 1       %NCUSR  Closed by user.
5189                 2       %NCFRN  Closed by foreign host.
5190                 3       %NCRST  Foreign host reset itself.
5191                 4       %NCDED  Foreign host dead.
5192                 5       %NCINC  Incomplete transmission.
5193                 6       %NCBYT  Byte size mismatch.
5194                 7       %NCNCP  Local NCP went down (local host dead).
5195                 10      %NCRFS  Request for Connection rejected by fgn host.
5196
5197         For a TCP channel:
5198         val 1   %WYTCP
5199         val 2   state code (see below)
5200         val 3   input: # bytes avail, output: # bytes free in buffer
5201         val 4   Close reason (same values/meanings as for NET.  See
5202                 definition of %NX== in SYSTEM;BITS > if curious.)
5203
5204         The TCP state codes are defined in SYSTEM;BITS > at %NT==:
5205         ; Legend: - Pre-Open, * Open, + Post-open, ? impossible.
5206         ;       I = can read, O = can write.
5207         ; Note that the input and output channels for a TCP connection
5208         ; will usually have different states.  Also, note that
5209         ; for all practical purposes, %NT and %NS symbols with the same
5210         ; value have the same meaning.  SYN = Request for connection.
5211                         ; In Out
5212         %NTCLS==:0      ; -  -  Closed (reason available from WHYINT)
5213         %NTLSN==:1      ; -  -  Listening for a SYN
5214         %NTSYR==:2      ; -  -  SYN received
5215         %NTCLU==:3      ; +  ?  Being closed by fgn host
5216         %NTSYN==:4      ; -  -  SYN sent, waiting for response
5217         %NTOPN==:5      ; *I *O Open
5218         %NTWRT==:6      ; ?  *O Output buffer full
5219         %NTCLX==:7      ; ?  +  Being closed by user
5220         %NTCLI==:10     ; +I ?  Closing/closed, input still available
5221         %NTINP==:11     ; *I ?  Open, input available
5222
5223
5224         Chaosnet:
5225         val 1 - %WYCHA
5226         val 2 - state
5227         val 3 - number of packets queued (receive,,transmit)
5228         val 4 - window size (receive,,transmit)
5229         val 5 - input channel#,,output channel# (-1 if not open or I/O-pushed)
5230
5231         LH(val 3) is the number of packets available to input IOT.
5232                   This is different from the number of received packets
5233                   if some are out of order.  This is increased by 1 if
5234                   there is a partially-read buffer available to SIOT;
5235                   this packet is not available to PKTIOT.  This is zero
5236                   if the connection is direct-connected to a STY.
5237
5238         RH(val 3) is the number of packet slots available in the output
5239                   window, i.e. the window size minus the number of packets
5240                   which have been transmitted by output IOT but which have
5241                   not yet been received and acknowledged by the foreign
5242                   host.
5243                   
5244         The state codes are:
5245
5246                 %CSCLS  Closed
5247                 %CSLSN  Listen
5248                 %CSRFC  RFC-received
5249                 %CSRFS  RFC-sent
5250                 %CSOPN  Open
5251                 %CSLOS  Broken by receipt of "LOS" packet.
5252                 %CSINC  Broken by incomplete transmission (no acknowledge
5253                         for a long time)
5254
5255 Errors:
5256
5257 34      WRONG TYPE DEVICE
5258         The specified channel supposedly never gives interrupts.
5259 \f
5260 XGPIM:  xerox graphic printer image output
5261
5262         arg 1   Address of a word with the number of pages of
5263                 data in the left half and the number of the first
5264                 data page in right half.
5265                 This word must be in writable memory.
5266
5267         Bits are shoved out onto the XGP.
5268
5269         I wonder what the precise semantics of this kludge are?