{ File:[22,320]QIOIBM.EXT Author: Peter Stadick (Phil Hannay (derived from QIOW.MAC)) History: 08-Aug-86 -- created. Last Edit: 10-AUG-1986 13:03:11 } Procedure QIOIBM(LUN:Integer; EFNR:Event_flag; EFNW:Event_flag; Inadr:Address; Insiz:Integer; Timeout:INTEGER; Outadr:Address; Outsiz:Integer; Ttable:Address; VAR Iostat:IO_status_block );EXTERNAL; {NOLIST} {*USER* Pascal-3 Procedure to execute QIO Read with write function for comminications with an IBM series one. This procedure is provided since it won't fit into the normal parameters for the Pascal-3 QIOW procedure. This will be done, outputting characters specified by OUTADR and OUTSIZ, and inputting the response characters into the area specified by INADR and INSIZ. Note that we order the input and output buffer parmeters in the same order as the QIO parameter list, so that we specify the input buffer and size first, and then later, the output buffer and size. This may seem inconsistent since we output first and then input. But this keeps it consistent with the order if your used to using the QIO in macro. No vertical form control will be provided. This means that there will be no after the prompt output. If you desire different form control, you must embed the desired form control characters into the output prompt. LUN is the logical unit number to be assigned to the appropriate device. EFN is the event flag to be set when the I/O is completed. f0 may not be specified. EFNR is used for the read and EFNW is used for the write. INADR is the starting address of the buffer to be written as the prompt. Use LOOPHOLE(Address,Ref(string)) to produce this parameter. INSIZ is the size of the buffer referenced by OUTADR. This value must not exceed the size of the buffer referenced by OUTADR to prevent writing beyond the end of the buffer. It can be smaller than the buffer, to terminate the qio on a fixed number of characters. Timeout is an optional feature. If used, the number passed should reflect the number of 10-second intervals that should elapse before processing continues. The 10-second feature is not terribly accurate; specifying an interval of 10 seconds may give an interval of from 1 to 10 seconds. A zero indicates a "zero timeout" is to be done, a negative value indicates "no timeout" is to be done, and a positive value indicates "timeout of value*10 seconds" to be done. Note that this will conform to Version 3.0 of M+, when zero timeouts are implemented. Previous QIO procedures did not accomodate zero timeouts. OUTADR is the starting address of the buffer to be written as the prompt. Use LOOPHOLE(Address,Ref(string)) to produce this parameter. OUTSIZ is the size of the buffer referenced by OUTADR. TTABLE is the starting address of the 16 word terminator table. IOSTAT represents the two words of the IO status block. IOSTAT[1] contains the IO status word. For read functions, the high byte contains the terminating character and the low byte the 1 for success. If input terminated on char count, IOSTAT[1] will be just 1, and terminating character 0 (null). If input terminated on timeout, IOSTAT[1] will be 2, and terminating character 0 (null). IOSTAT[2] is the second word of the IO status block, for read functions, it contains the byte count of characters read in (not counting the . Directive status is available in $DSW on return. } {LIST}