Specifications
0. The Valid Operations
The valid operations are currently:
- SETUP — indicated by an operation number of 1
- EXECUTE — indicated by an operation number of 2
- TRANSMIT — indicated by an operation number of 3
- UPDATE — indicated by an operation number of 4
- FLUSH connection — indicated by an operation number of 5
- MODESET — indicated by an operation number of 6
An invalid operation number is an error condition (condition number 0).
1. The SETUP Request
The mode field of the first word is ignored. SETUP requires an argument word. The arguments A1 and A2 are both treated like lengths, so both must be non-negative numbers. If they are not, error condition 2 is recognized.
1A. A1 Strictly Positive
If A1 is strictly positive, then this request describes a whole new display program, and any previous display program from this user is to be forgotten. In this case, A1 is the total length of the display program, exclusive of the area to be addressed by the Write Address Register (WAR). A2 is the length of the area to be addressed by the WAR. As such, A2 must be at least twice the greatest possible number of visible line segments to be displayed. (If the LDS-1 programmer feels sure of himself, he may set up his own "WAR area" and set his own "Output To Memory" modes. He would not need to use the A2 parameter at all.)
An acknowledge message is sent (unless suppressed; see MODESET). Then the display program is read (which consists of (A1) words).
1B. A1 Equal to Zero
If A1 is zero then this request is for a change in the length of the area to be addressed by the WAR. A2 contains the new length. A2 may be larger or smaller than the current length of the area. If no previous 1A type of SETUP request has been processed, error condition 1 is recognized. Otherwise an acknowledge message is sent (unless suppressed, see MODESET).
(This request would typically be used if an initial estimate on the number of words required were too low. Error condition 5, described under EXECUTE may be indicate a low estimate.)
2. The EXECUTE Request
The EXECUTE request does not take a parameter word, but the mode field is used to specify the number of times that the "EXECUTE action" is to be performed. (This "action" is described in detail following this paragraph. Briefly, it is a single execution of the display program.) If the mode field is zero or negative, then one EXECUTE action is performed. Whenever an error is encountered during a multiple EXECUTE, the iteration is immediately stopped. This way, the status of the display program after the error is not destroyed, and no flood of error messages is ever sent, only a single one.
The EXECUTE action is as follows:
If no previous SETUP request has been processed, error condition number 1 will be recognized.
An attempt is made to seize the E&S LSD-1 display processor. (If a previous EXECUTE has succeeded in seizing it, then this will also succeed. If some other user of the DMCG machine has control of the display processor, this will fail and error condition 4 will be recognized.)
The display program is now executed. The environment at the beginning of execution of the display program is given in Appendix 1.
If a previous execute failed in a way indicating a programming error in the display program (error conditions 6,7 and 8), then an SETUP or an UPDATE request must be executed before another request will be processed.
(If no SETUP of UPDATE is given before another EXECUTE, then error condition 3 is recognized.)
If the LDS-1 runs for two seconds without causing an interrupt or jumping to the "finish" location (the word before the origin of the display program) then it is assumed the program is running away. The LDS-1 is stopped, and error condition 6 is recognized. (A SETUP or an UPDATE is required before another EXECUTE is permitted.)
If the LDS-1 stops because too many output words are stored (i.e., if the WCR becomes positive or zero), error condition 5 is recognized. The number of output words made available to the user is as specified by A2 of the most recent SETUP request.
If the LDS stops in any manner other than either those described above or by jumping to the word before the origin (the "finish" location), then error condition 7 is recognized. (A SETUP or an UPDATE is required before another EXECUTE is permitted.)
If the LDS-1 stops by jumping to the finish location, then the value of the WAR at the time determines the amount of output in the "WAR area" which the user may have access to.
If the WAR has been altered so that it contains an address smaller than its initial value, then the effective value of the WAR is its initial value. If the WAR contains a value greater than the address of the end of the area for output, then a WCR stop error is imitated (the effective value of the WAR is the maximum allowed by SETUP and error condition 5 is recognized). The situation in which no error is recognized will be called a "normal stop".
Summary for Normal Stop:
Origin |
----->+-----------------+ |
| | |
| Display Program | - <--If WAR here, it is set to here._
| | | |
+-----------------+ _| |
|
<-------------------------------------+
_
+-----------------+ |
| | |
| WAR output area | - <--If WAR here, it is left alone.
| | |
+-----------------+ _|
_ <-----------------------------------+
| |
| |
- <--If WAR here, it is set to here,+
| and error condition 5 is
| recognized.
|
If no error condition is recognized for an EXECUTE request, an acknowledge message is sent (unless suppressed; see MODE SET). The effective value of the WAR is saved for later use in determining how much output the display program generated, but it is saved only for normal stops and WRC positive stops.
After normal stop, if Auto-TRANSMIT mode is set (see MODESET, below) then a TRANSMIT request is simulated (using the arguments specified in the MODESET request which initiated Auto-TRANSMIT mode). Otherwise the next request is begun.
3. The TRANSMIT Request
Transmit takes one argument word and decodes the mode field, except in special cases. Normally A1 indicates the number of words of display program and/or output (in the WAR area) which are to be transmitted (possibly after data format conversion as indicated by the mode field). A2 indicates the starting address of the block of data to be (converted and) sent.
3A. Special Case: A2 Is Zero
If A2 is zero, the mode and A1 are ignored. In this case an acknowledge message is sent (unless suppressed), a length word (containing 1) is sent (36 bits - left half word equals 1, right halfword equals zero) and then a word containing the origin address for display programs. (This address should always be 1000 (octal); it might have to change, however, and this mechanism is provided to permit the user to determine what its value is.)
3B. Normal Case: A2 Is Non-Zero
The normal case is when A2 is non-zero.
If there has never been a SETUP request, error condition 1 is recognized. If the mode field is non-zero or 1, or if A1 is negative, or A2 is less than the origin (but not zero), or A1 + A2 is greater than the current "effective value of the WAR" (read on), then error condition 2 is recognized.
The "effective value of WAR" always points to the word beyond the last word of output from the LDS-1. Before the first EXECUTE request, it points to the word after the end of the display program (indicating that zero words have been output). EXECUTE requests effect the value in various ways (depending on error conditions, etc.) as described previously. The effective WAR value is also changed to correctly reflect the effect of SETUP requests, which can change the size of the WAR area (type 1.B), and UPDATE request, which can increase the size of the display program causing the whole WAR arla to be shifted.
If the parameters are correct, an acknowledge message is sent (unless suppressed; see MODESET).
If A1, the number of words to be reformatted (possibly) and sent, is zero it is understood that the block of words to be processed starts at A2 and terminates with the last word before the effective WAR value. (Thus the number of words to be processed is "the effective WAR value minus A2".)
If the mode field of the first word of the request is zero then no reformatting will be done: an exact copy of the core image will be transmitted. If it is a one, then the block of words to be processed is assumed to contain the coordinates of end points of a sequence of line segments. (The odd numbered words (starting counting with one, not zero!) are assumed to represent set-point data and the even-numbered words are assumed to contain draw-to data. (Note that this is consistent with LDS-1 "Scaled Coordinate to Memory" mode as long as no dots are displayed!!) The line segments are recoded in ARDS format, five seven-bit ASCII characters to a word, with the right most bit of each 36 word unspecified. The last word may contain null ASCII characters (all zero) to fill out the word.
The first word transmitted (after the acknowledge message, if any) has a left half of 3 and a right half of: 0 (for exact core image) or 1 (for ARDS format).
The next word has a left half equal to the number of words which follow and a right half of zero. For ARDS format, this is the number of words after reformatting (of course).
Unless zero words are to be transmitted, the next words are the data request.
Note that the following sequence of requests could be used to simply convert line data (in the correct format) to ARDS format:
(The notation "A,,B" stands for a 36 bit word whose left half has the value "A" and whose right half has the value "B".)
Establish network connection
SETUP,,0 ; start
2n,,0 ; data representing "n" line
; segments follow
+----------------+ _
| | |
| | - 2n coordinate pairs
| | _|
+----------------+
TRANSMIT,,2 ; request ARDS transmission
0,,1000 ; convert and transmit the
; whole "program"
FLUSH,,0 ; signoff
4. The UPDATE Request
The UPDATE request allows a portion of the display program to be altered and also allows the end of the display to be extended (to include more data perhaps). The mode field of the first word of the request indicates the number times the EXECUTE-action is to be performed if the UPDATE request is successful. The UPDATE request takes an argument word which is similar to that of TRANSMIT (i.e., A1 is a length and A2 is an address).
If no SETUP request has previously been executed error condition 1 is recognized.
If A1 is negative or if A2 is less than the origin of the display program, error condition 2 is recognized.
If A1 + A2 is greater than the end of the display program, then the length of the display program is increased to equal "A1 + A2 - origin". The WAR area remains the same length as before, and its contents are shifted to their new locations. The "effective WAR value" (see TRANSMIT) is increased by the amount of increase in display program length.
An acknowledge message is sent (unless suppressed) if no error condition is recognized (and if no problem with core size limitation arises). Also, the flag which is set by severe error conditions encountered during EXECUTE requests, is cleared by successful UPDATE requests.
The next "A1" words are read and stored in consecutive locations starting in location "A2". If A1 is zero, no words are read.
If the mode field of the first word of the UPDATE request is positive, it is taken as an iteration count for a multiple EXECUTE request. Otherwise, the next request is read from the Network.
5. The FLUSH Request
The Flush request takes no arguments and ignores the mode field of the first word of the request. No acknowledge message is sent. The network connection is broken and the process destroys itself.
6. THE MODESET Request
The mode field of the first request word is decoded first. If it is zero or less, or if it is greater than (currently) 6, error condition 2 is recognized.
6A. Mode Field 1
If the mode field is 1, then acknowledge messages and ASCII error messages are not to be suppressed.
6B. Mode Field 2
If the mode field is 2, then acknowledge messages and ASCII error messages are to be suppressed.
6C. Mode Field 3
If the mode field is 3, exit from Auto TRANSMIT mode. (See 6D.)
6D. Mode Field 4 or 5
If the mode field is 4 or 5, whenever an EXECUTE has a normal stop, a TRANSMIT request is to be automatically performed.
The mode field for the transmit is to be 4 less than the mode field for this MODESET request. One (more) word is read from the network. It contains the arguments for the TRANSMIT. (That is, the word is saved and used when the TRANSMIT operation is performed. The values of the arguments are checked at that time, not during the MODESET request.