Input/Output Routines

Flash

JSBR IZ 1653
P1=Byte Address of Variable Length Character String

Requests that the ASCII character string be transmitted to all I/O stations. The string is ended by a NUL byte.

In order that the transmissions should not unduly confuse operators the string should start with the characters SP SO BEL and end with SI SP NUL (thus displaying the intervening text in inverse video if this is provided by the receiving device). The text should include reasonable identification of where the message has come from (e.g. program name and task number).

Control returns to the issuing task immediately the request has been placed, thereby ensuring its continuation even if the operating system is unable to honour the request. There is no guarantee that the string will arrive at any given station; if it is off-line no retry attempt is made; if an output is currently in progress the OS will wait until it is completed; an input is interrupted immediately.

Since flash requests are not queued, and since each receiving station handles the request at its own pace, it is possible to loose a message if another Flash Request supersedes it. In particular, if a task issues two Flash requests the first will certainly be lost unless a SUSPEND subroutine call intervenes to allow the Task Scheduler to honour the first request.

Flash Single Station

JSBR IZ 1654
P1=Byte Address of Variable Length Character String

Requests that the ASCII character string be transmitted to the task who’s Task Number is contained in the A-Register on entry (this must be a valid I/O station task number).

Implementation is identical to that of the general FLASH subroutine.

Get

JSBR IZ 1640
P1=Address of Control Word in Parameter Block

Outputs a prompt message to the task’s I/O station and awaits a reply. The reply will be validated and processed accoding to the instructions given in the Control Word. There are three principle processing modes - Character, Binary and Fetch – separately described below.

In all cases control returns to the step following P1 upon satisfactory completion of input and processing. The original characters input from the station will be found in ASCII in the task’s Input Buffer (terminated by NUL) and the number of characters input (excluding terminator) in Absolute Core Location 000045. The ESCAPE key aborts the call, control passing to the Escape Point nominated by P0 or, in default, by the Specify Escape Point subroutine.

Character Mode - Parameter Block

P0
Address of Escape Point (Optional: Control Word B9 set indicates presence of P0).
P1
Control Word (see below).
P2
Byte Address of Prompt Message (Variable length ASCII character string terminated by NUL).
P3
(Byte) Address of Target Area (Optional: required only when Convert to Metacode or Move & Pad requested).

Character Mode - Control Word

B17:B16
01
B15
Set if Input is to be converted to Metacode. The Metacode is stored at the address specified by P3. Byte Addressing is not allowed.
B14
Set if input is to be moved to the Byte Address specified by P3 and, if short, space filled to the maximum length specified in B7:B1. Only the Target Area is space-filled, not the input buffer. This bit is ignored if B15 is set.
B13
Set if input is not to be flashed back (echoed) to the task’s output display (could be used to preserve password security).
B12:B10
000
B9
Set if P0 is present (Escape)
B8
0
B7:B1
Maximum Length (characters) of Input. The terminator (ACCEPT key) is not counted when determining the length.

Binary Mode - Parameter Block

P0
Address of Escape Point (Optional: Control Word B9 set indicates presence of P0).
P1
Control Word (see below).
P2
Byte Address of Prompt Message (Variable length ASCII character string terminated by NUL).
P3
Address of Binary Target.
P4
Address of Minimum Value (required only when Testing Between Limits).
P5
Address of Maximum Value (required only when Testing Between Limits).

Binary Mode - Control Word

B17
0
B16
Set if Negative Input to be rejected.
B15
Set if input is to be tested between limits. P4 and P5 must point to the minimum and maximum values respectively. These values must have the Word Length specified in Control Word B8:B7; P5 must not be less than P4 and P4 must not be negative.
B14
Set if the Input must include the correct check digit. The Binary Target must be Single Word and not negative.
B13
Alpha Feature. Set if input which starts with a non-numeric character is not to result in ERROR. The calling program may detect this occurrence by testing the A-Register on return; if zero then the input was numeric (with correct check digit if applicable), otherwise the A-Register contains the first input character in ASCII in the bottom byte (the top byte is NUL) and the Binary Target will be unchanged. If there was no input (other than ACCEPT) this is interpreted as non-numeric and the A-Register sign bit B17 is set, unless the NUL feature (see B12) is also specified in which case the A-Register will be zero.
B12
NUL Feature. Set if input consisting of ACCEPT only is to leave the Binary Target unchanged. The Target will, however, still be subject to any tests specified by Control Word B16 & B15. If B12 is not set, input of ACCEPT only will be interpreted as input of the value zero unless the Alpha Feature (see B13) is active.
B11:B10
00
B9
Set if P0 is present (Escape)
B8:B7
Word Length of Binary Target (must not be zero).
B6:B5
00
B4:B1
Number of Decimal Places in Binary Target. Free format is allowed on input; any necessary adjustment to the precision is carried out automatically (excess digits are truncated).

Fetch Mode - Parameter Block

P0
Address of Escape Point (Optional: Control Word B9 set indicates presence of P0).
P1
Control Word (see below).
P2
Byte Address of Prompt Message (Variable length ASCII character string terminated by NUL).
P3
Address of Key Area. For Direct Access files, this must be a single word binary field.
P4
Address of Extract Area. Set zero if extraction is not required.

Fetch Mode - Control Word

B17
0
B16
1 to reject loaded records,
0 to reject records not loaded.
B15
No Test. If not set, the TEST option will be applied on FETCH.
B14
Set if the Input Key must include the correct check digit (applies to Direct Access files only).
B13
Alpha Feature (applies to Direct Access files only). Set if input which starts with a non-numeric character is not to result in ERROR. The calling program may detect this occurance by testing the A-Register on return; if zero then the input was numeric (with correct check digit if applicable), otherwise the A-Register contains the first input character in ASCII in the bottom byte (the top byte is NUL). FETCH does not occur on Alpha Input and the Key Area will be unchanged. If there was no input (other than ACCEPT) this is interpreted as non-numeric and the A-Register sign bit B17 is set, unless the NUL feature (see B12) is also specified in which case the A-Register will be zero.
B12
NUL Feature (applies to Direct Access files only). Set if input consisting of ACCEPT only is to leave the Key Area unchanged. The Key will, however, still be subject to any tests specified by Control Word B16 & B15. If B12 is not set, input of ACCEPT only will be interpreted as input of the value zero unless the Alpha Feature (see B13) is active.
B11:B10
01
B9
Set if P0 is present (Escape)
B8:B1
File Identifier.

On return from GET (Fetch Mode), the Key Area will contain the Relative Record Number (in the case of a Direct Access file). The record will have been extracted if this was requested by P4.

Get Password

JSBR IZ 1635
P1=Byte Address of Password

Outputs the prompt PASSWORD to the issuing task’s I/O station, and awaits a reply of maximum length 12 characters.

The reply is compared, character-by-character, with the password pointed to by P1. If an inequality is detected, control is passed to the ERROR handler (PASSWORD prompt will be re-output). If the input matches the password, control returns to the step following P1.

Control is passed to the PROGRAM? prompt if the I/O station ESCAPE key is pressed.

The end of the password is indicated by a NUL byte.

Flashback is suppressed on input (the password does not appear on the I/O station display).

Inhibit

JSBR IZ 1636

This subroutine provides security protection to I/O station programs without the need for authorised operators to be given a password.

On entry, the A-Register must contain a mask identifying the program class (e.g. B2=Customer File Maintenance). Control returns to the step following JSBR if the class is permitted to run, otherwise the station will BEL, display INHIBITED! and return to the PROGRAM? prompt.

Class Inhibit Flags are held in the System Control Record at 0/0474; they may be switched by a (password protected) program. Flag B1 is reserved for Systems Programs.

Print Line

JSBR IZ 1644

The line set up within the issuing task’s Inner Print Buffer is scheduled for output, the Inner Print Buffer is space-filled, and control returns to the step following JSBR.

On entry, the A-Register must contain one of the following:

Standard line length is 132 characters.

The address of the start of the task’s Inner Print Buffer is held in core location 0/0066.

ASCII control characters (NUL, CR, LF, VT, BEL etc.) encountered in the Inner Print Buffer will be printed as a space.

The routine (in its standard version) provides automatic triple-buffering facilities, by which is meant the contents of the Inner Buffer are transferred to one of two available Outer Buffers from which output is effected asynchronously from main-line processing.

The calling routine may assume the Inner Buffer to be space-filled initially.

A blank line is not output; rather the appropriate number of line feeds will be added to the next line, or the form feed or vertical tab executed. The routine handles operator Suspend, Run and Cancel commands automatically. In the event of cancellation, the routine does not return control to the calling program. To disallow cancellation, B17 of word 3742- (within the printer’s Task Control Area) should be set prior to calling PRINT LINE (this bit will remain set until the program returns to the control program (JUMP Z 1406)).

Put

JSBR IZ 1652
P1=Byte Address of Variable Length Character String

Transmits the ASCII character string to the issuing task’s output terminal. The string is ended with a NUL byte.

This routine is intended for I/O stations when no reply is required; it cannot be used to output to a printer.

Since no reply is required, the issuing task may continue immediately the output is complete (this makes it impossible to read the message at an alphanumeric keyboard because a new output usually starts almost immediately).

Device Considerations

Special ASCII codes inserted within the character string may be interpreted differently by different devices, and should therefore be avoided. The operating system will, however, standardise the following codes:

CR
Carriage Return and Line Feed on VDUs, printers, teletypes etc.
Clear Screen on Alphanumeric Keyboards.
BEL
Momentarily sound the alarm.

Split

JSBR IZ 1640
P1=Address of Control Word in Parameter Block

Outputs a prompt message to the task’s I/O station and awaits a YES/NO reply. Optionally allows for additional character input when the reply is YES.

The subroutine returns to the step following P1 if the reply is NO; the subroutine skips this step on return if the reply is YES. In the latter case any additional input will be found (terminated by NUL) in ASCII in the task’s Input Buffer and the number of characters input (excluding terminator) in Absolute Core Location 00/0045.

A YES reply is indicated by pressing the station’s ACCEPT key (after entering any additional data), a NO reply by pressing the CANCEL key. The ESCAPE key aborts the call, control passing to the Escape Point nominated by P0 or, in default, by the Specify Escape Point Subroutine.

Parameter Block

P0
Address of Escape Point (Optional: Control Word B9 set indicates presence of P0).
P1
Control Word (see below).
P2
Byte Address of Prompt Message (Variable length ASCII character string terminated by NUL).

Control Word

B17:B10
01 000 000
B9
Set if P0 is present (Escape)
B8
0
B7:B1
Maximum Length (characters) of Additional Input

Specify I/O Station Escape Point

JSBR IZ 1634
P1=Address of Escape Point

Enables the programmer to specify the address of the instruction to which control is to pass if the Escape key is pressed at the issuing task’s I/O station. This event will be automatically detected by the Operating System.

The specification remains in force until superseded by a new call to this subroutine specifying a different address, but may be overridden on individual calls to the GET and SPLIT subroutines.

To prohibit escape attempts, set P1 = 00/1405 (this Escape Point calls the error handler, and is automatically established when the task starts a new program).

The following standards should be adopted whenever practicable:

On return from this subroutine the A-Register will contain the address of the previous Escape Point.