GDSX (Extended General Device Support) Manual

Design and Development
Extended General Device Support (GDSX) Manual529931-001
2-102
The LINE^HANDLER Procedure
Entries in the state transition table (line^state^table) contain four bytes, as follows:
Byte 0: Current state
Byte 1: Result of previous action
Byte 2: Next action
Byte 3: Next state
The line state machine consists of an indefinite loop in which:
1. The result of the previous line action is evaluated and stored in the local variable
rslt. This evaluation is done by a CASE FORM expression with the case index
being the current line state. Typed subprocedures return a number indicating the
result of each particular action.
2. The state transition table is indexed based on the current line state and rslt.
When a match is found, byte 2 of the matching entry is stored in the local variable
action and the line state is changed to byte 3 of the entry. If a match is not found,
there is an error in constructing the state transition table.
3. The next line action is initiated by a CASE statement, which uses action as an
index. The possible actions are:
1 : la^null: Do nothing (but continue in the state machine).
2 : la^write: Initiate a WRITE operation on the line. If the operation is
successfully initiated, exit the state machine.
3 : la^abort: Issue a “Line aborted” message and exit the state machine.
4 : la^read: Initiate a READ operation on the line. If the operation is
successfully initiated, exit the state machine.
5 : la^reset: Initiate a CONTROL 13 on the line. If the operation is
successfully initiated, exit the state machine.
6 : la^wait: Exit the state machine.
Note that in those cases that initiate nowait I/O operations, if the operation is
initiated successfully, the state machine is exited and is reentered when the I/O
completes.
If the I/O is not successfully initiated, a file management error number is stored in
the variable action^error, and the subprocedure that attempted the I/O returns
zero. When this happens, the state machine obtains a temporary IOCB by a call
on ALLOCATEIOCB and stores action^error in iocb.err. In this way, the code for
handling I/O completions within the state machine does not have to be sensitive to
whether the error was detected at I/O initiation time or was returned at I/O
completion.
When an initial read operation completes, the subprocedure INITIAL^READ is called.
INITIAL^READ resets the poll^halting flag, then determines whether polling completed
with no subdevice responding (file error 176). If the latter is the case, any subdevices