HAL/S
HAL/S (High-order Assembly Language/Shuttle)
Goals and principles
The three key principles in designing the language were reliability, efficiency, and
HAL/S was designed not to include some constructs that were thought to be the cause of
Some features, such as "
"HAL" was suggested as the name of the new language by Ed Copps, a founding director of
- fundamental contributions to the concept and implementation of MAC were made by Dr. J. Halcombe Laning of the Draper Laboratory.
A proposal for a NASA standard ground-based version of HAL named HAL/G for "ground" was proposed, but the coming emergence of the soon to be named Ada programming language contributed to Intermetrics' lack of interest in continuing this work. Instead, Intermetrics would place emphasis on what would be the "Red" finalist which would not be selected.
Host compiler systems have been implemented on an IBM 360/370,
Syntax
HAL/S is a mostly free-form language: statements may begin anywhere on a line and may spill over the next lines, and multiple statements may be fitted onto the same line if required. However, non-space characters in the first column of a program line may have special significance. For instance, the letter 'C' in the first column indicates that the whole line is a comment and should be ignored by the compiler.
One particularly interesting feature of HAL/S is that it supports, in addition to a normal single line text format, an optional three-line input format in which three source code lines are used for each statement. In this format, the first and third lines are usable for superscripts (exponents) and subscripts (indices). The multi-line format was designed to permit writing of HAL/S code that is similar to mathematical notation.
As an example, the statement could be written in single-line format as:
X = A ** 2 + B$(I) ** 2
Exponentiation is denoted by two asterisks, as in PL/I and Fortran. The subscript is denoted by a
E 2 2 M X = A + B S I
In the example, the base line of the statement is indicated by an 'M' in the first column, the exponent line is indicated by an 'E', and the subscript line is indicated by an 'S'.
Example
The following is a simple HAL/S program.[8] Every program begins with a labeled PROGRAM
statement; the label consists of an identifier followed by a colon. All variables must be declared in the DECLARE
group, which precedes any executable statements. Every program ends with a CLOSE
delimiting statement.
SIMPLE: PROGRAM; C CODE IN THIS TYPEFACE IS C HAL/S SOURCE DECLARE PI CONSTANT (3.14159266); DECLARE R SCALAR; READ(5) R; WRITE(6) PI R**2; CLOSE SIMPLE;
Data types
HAL/S has native support for
of 8-bit characters, limited to a maximum length of 255. Structured types may be composed using aDECLARE STRUCT
statement.
See also
- Fortress, a programming language with advanced syntactic support for mathematical expressions
- IBM AP-101, the space shuttle avionics computer
References
- ^ "STS Software". NSTS 1988 News Reference Manual. NASA. Retrieved 2011-03-30.
- ISBN 978-0-309-04880-4.
- ^ Lytle, P.J. (1981). "Current Status of the HAL/S Compiler". Archive.org.
- ^ "The Development of Hal/S". Department of Computer Science, University of Toronto.
- ^ a b c "HAL/S Language Specification" (PDF). November 2005. Archived from the original (PDF) on 2009-02-26. Retrieved 2016-11-16.
- ^ Ryer, Michael J. (1979). "Programming in HAL/S" (PDF). Source: NASA Technical Reports Server. Retrieved 2016-02-14.
- ^ Lytle, P.J. (1981). "Current Status of the HAL/S Compiler".
- ^ Ryer, Michael (September 1978). Programming in HAL/S (PDF). NASA. p. 2-1.
External links
- NASA Office of Logic Design: Space Shuttle Computers and Avionics
- Includes language and compiler specifications, programmer's guide, and user manual.
- Computers in Spaceflight: The NASA Experience – By George Tomayko (Appendix II: "HAL/S, A Real-Time Language for Spaceflight")