GDSX Manual
DEVICE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual–134303
5-18
The USER^STOP Procedure
Display the contents of the IOCB pointed to by lastrcviocb:
- DISPLAY (iocb-address) AS IOCB^TEMPLATE
and record the value of iocnt.
The buffer address is held in the doubleword variable bufaddrx. Record the value of
bufaddrx (buffer-address).
Now convert the buffer address value to octal with the command:
- D (buffer-address) IN OCTAL
and record the displayed quantity (octal-buffer-address).
The conversion to octal is necessary because high-level Inspect displays INT variables,
such as bufaddr, as signed quantities. Addresses in the upper 32K words of your
program’s data space will appear as negative numbers. Low-level Inspect, which you
will use to display the ASCII contents of buffers, expects unsigned values, octal by
default; hence, the conversion is necessary.
Enter low-level Inspect, and display the buffer contents in ASCII by entering:
- LOW
- A octal-buffer-address, 40
There should be eight spaces, followed by the reversed string of characters that you
entered at the application terminal.
Return to high-level Inspect and enter “R“ to resume program execution. The text you
observed at buffer-address should now display on the application terminal, except
for the additional datastream conversion. At the next breakpoint, enter STOP.
At the TACL terminal, confirm that both the GDSX process and the requester are gone.
Then log off all terminals.
The USER^STOP Procedure
In an exercise in the previous section, an SU was stopped with an SCF ABORT
command. The abort message was sent to TSCODE, which then stopped the
DEVICE^HANDLER task.
When the task was stopped, the USER^STOP user exit was called by TSCODE, as
shown in Example 5-5. Because the stopped task, whose TCB address is passed in the
call to USER^STOP, was waiting on a ^WRITEREAD (dcb.wt^rd^pend equal to TRUE)
and was indeed a DEVICE^HANDLER task (in which case tcb.state is less than or equal
to 15), then ^CANCEL was called on the file to which the task was mapped (tcb.term,
which is the same as term^file^num for the DEVICE^HANDLER task).