• Keine Ergebnisse gefunden

HAL/S INPUT-OUTPUT OPERATIONS 6.1 Sequential I/O

Im Dokument HAL/S-FC USER’S MANUAL (Seite 77-81)

DECLARE I INTEGER INITIAL(4);

Type 2 Options Standard Form

10. The DATA_REMOTE directive has the form:

6.0 HAL/S INPUT-OUTPUT OPERATIONS 6.1 Sequential I/O

Sequential I/O is that part of the HAL/S input-output capability consisting of the READ, WRITE, and READALL statements. It is the only I/O capability available on the FC. This section will describe the types of files available for sequential I/O, the input data types expected, standard formatting performed on output, and some JCL considerations.

Note that the I/O operations described here are those performed when simulated FC execution is taking place. This form of output is intended only for program checkout purposes and is in no way meant to correspond to the actual flight computer I/O

structure. In fact, all I/O operations for FSW are setup by the HAL/S-FC runtime library and actually performed by the operating system.

In certain cases, these operations may not be precisely identical to those described in the Language Specification.

6.1.1 PAGED and UNPAGED Channels

As described in the Language Specification, Section 10.1, files used for sequential I/O are considered by the HAL/S system to be in either PAGED or UNPAGED mode. The file mode determines both the effect of various I/O control functions (LINE, PAGE, etc.) and the format in which output is produced. The I/O control functions are described in Section 10.1.3 of the Language Specification, while output formats will be described below, in Section 6.1.3.

Default modes are assigned to files depending on their use: files used only as output channels are presumed to be PAGED, while those used for input to READ or READALL statements are presumed to be UNPAGED. For simple applications, these defaults are satisfactory, but in cases where a file used for output at one point in a program is to be used for input later on, some changes may be needed. Information on how to specify PAGED or UNPAGED mode for a particular I/O channel may be found in Section 5.2(1).

6.1.2 Input Data Formats

The system expects any data which serves as input to READ statements in a HAL/S program to be in the following form:

1. SCALAR and INTEGER data types may be entered in either a whole number or floating point format. The whole number representation consists of a string of decimal digits preceded by an optional - sign. Conversion to mantissa-exponent form takes place for scalar types.

The floating-point representation is either:

ddd.dddd or

HAL/S-FC User’s Manual USA003090 32.0/17.0

6-2 November 2005

E

dddd.dddd B ±dd H

where d is a decimal digit. The decimal point may appear in any position. E,B, and H represent the exponent digits to be powers of 10, 2, and 16 respectively.

There is no limit on the number of digits in the integral, fractional, or exponent parts although runtime errors may occur if the value is internally unrepresentable (see Section 8.2 for the maximum and minimum representable values). For INTEGER types, the representation is rounded to the nearest integral value. The floating-point representation may be prefixed by a + or - sign to indicate the sign of the value. In the absence of such a prefix, the value is assumed to be positive.

2. CHARACTER types are represented by a string of characters (from the HAL/S extended set) enclosed in apostrophes. The number of characters may vary between zero (a “null string”) and 255. Within the string, apostrophes must be represented by an apostrophe pair.

Note that the READALL statement may be used to allow input of character strings without requiring them to occur within apostrophes. See Language Specification, Section 10.1.1.

3. BIT types may be represented by a string of ‘1’s and ‘0’s enclosed in apostrophes.

Embedded blanks are ignored. The number of bits may vary between one and 32. An alternate representation allows bit strings to be implicitly expressed by coding a floating-point number in the format described in (1), above. The number is rounded to the nearest integral value, and the binary representation of the resulting integer is taken.

6.1.3 Output Data Formats

Output from WRITE statements will be produced in the following form:

1. Integers - each integer, no matter what its precision, is printed in an 11-character field. The number is right justified, and leading zeros are suppressed. A minus sign precedes the number if necessary.

2. Scalars -

• Single precision: a 14-character field is printed as follows:

sd.dddddddE±dd

where s is a blank or minus sign.

• Double precision: a 23-character field is printed as follows:

sd.ddddddddddddddddE±dd 3. Bit Strings

-• If the output channel is PAGED, the output consists of a string of binary digits corresponding to the bit string. Leading binary zeroes are not suppressed. The field width is equal to the number of binary digits in the string plus an inserted

blank following every fourth digit (to enhance readability). This form may not be used later as input to READ statements.

• If the output channel is UNPAGED, the output consists of the string of binary digits plus inserted blanks enclosed within apostrophes. The field width is equal to the total of the number of digits, blanks and two apostrophes. This form is compatible with later use in READ statements.

4. Character Strings

-• If the output channel is PAGED, the output merely consists of the string of characters comprising the value. The field width is equal to the number of characters in the string. This representation is not compatible with later use as input to READ statements. It is compatible with READALL, however.

• If the output channel is UNPAGED, the string of characters is enclosed in apostrophes, and all internal apostrophes are converted to apostrophe pairs.

The field width is equal to the total number of characters in the string, including added apostrophes. This form is compatible with later use as input to READ statements.

6.1.4 JCL Considerations

The device numbers used in WRITE, READ, and READALL statements are limited to the range from 2 to 9. The ddname associated with device number n (where n is within this range) is CHANNELn.

The HAL/S I/O routines make certain assumptions about the characteristics of the datasets which are defined on the various CHANNELn DD cards. The user may supply any, all, or none of the DCB attributes for each CHANNELn DD card. The following restrictions and defaults are defined:

RECFM - the record formats acceptable to HAL/S are:

F FB FA FBA FBSA V VB VA VBA

U UA

Machine carriage control (M) is acceptable but is subject to the interpretation described below, under “carriage control”.

Variable length records may be read as input, but the 4 byte descriptor field on each record will not be available to the programmer. Thus, the effective length of a variable record will be four less than the length read. Variable length record specification on output will cause records to be written in variable format. Format U records (undefined record format) on output will be written in the proper form, but all records will have the same LRECL (length).

If no RECFM is supplied, the record formats assigned are FBA (for PAGED files), and FB (for UNPAGED files).

LRECL - if not supplied by JCL or dataset attributes, the default is 133 (for PAGED files)

HAL/S-FC User’s Manual USA003090 32.0/17.0

6-4 November 2005

and 80 (for UNPAGED files).

BLKSIZE - if no blocksize is supplied in the JCL or the dataset label, then the maximum block size of the particular device is found. The BLKSIZE is set to the largest multiple of LRECL which is less than or equal to this block size. Note that for tapes, this maximum size is 32767 bytes which would require a sizable buffer area to be taken out of main storage.

Carriage Control - PAGED files with “A” specified in the RECFM cause carriage control characters to be automatically generated on output. If a PAGED file has “M” specified, no such automatic character control generation takes place, and it is the user’s

responsibility to ensure that the first character of each output line has the proper control character. Control characters are not permitted on UNPAGED files used for output.

Carriage control characters encountered during input are available to the programmer;

i.e., scanning of the input begins at the carriage control character.

6.2 File I/O

File I/O is not supported by the HAL/S-FC runtime library. If a FILE I/O statement is compiled, unresolved external references will occur at link edit time.

7.0 THE HAL/S USER CONTROL PROGRAM (HALUCP)

Im Dokument HAL/S-FC USER’S MANUAL (Seite 77-81)