S3 is a structured, imperative high-level computer programming language. It was developed by the UK company International Computers Limited (ICL) for its 2900 Series mainframes. It is a system programming language with syntax influenced by ALGOL 68 but with data types and operators aligned to those offered by the 2900 Series. It was the implementation language of the operating system VME.
Annotated example A rare example of an S3 program available in the public domain is the implementation of Kermit developed at the South-West Universities Regional Computer Centre, and archived in the Columbia University archive of Kermit implementations. The examples below are selected highlights of the main module (kmt_main_module). The program starts with a module identification, and comments which we quote by way of acknowledgment to the authors:
MODULE KMT_MAIN_MODULE; @ Version 1.01 @
@------------------------------------------------------------------------------@ @ @ @ @ @ ----- S W U R C C V M E K E R M I T ----- @ @ @ @ @ @ ---------------------------------------------------------------- @ @ @ @ @ @ Version 1.00 (February 1986) @ @ @ @ Written by : Richard Andrews and David Lord, @ @ South West Universities Regional Computer Centre, @ @ Claverton Down, Bath BA2 7AY, U.K. @ @ @ @ @ @ ---------------------------------------------------------------- @ @ @ @ @ @ Version 1.01 (October 1986) @ @ @ @ Fixes by : Dave Allum and David Lord, SWURCC. @ @ ---------------------------------------------------------------- @
Next follow a number of "mode declarations". Mode is the Algol 68 term for a type.
MODE KMT_BUFFER IS (96)BYTE; MODE KMT_STRING IS REF()BYTE; MODE KMT_WORD IS REF()BYTE; MODE KMT_MTM_VALUES IS ANY (LONG WORD LW_VALUE, LONG INT LI_VALUE, REF WORD RW_VALUE, REF INT RI_VALUE, REF LONG WORD RLW_VALUE, REF LONG INT RLI_VALUE, REF()BYTE RVB_VALUE, REF()REF()BYTE RVRVB_VALUE); MODE KMT_PP_PACKET_STATISTICS_S IS STRUCT (INT INPUT_TOTAL, OUTPUT_TOTAL);
The first type is an array of 96 bytes; the next two are references (pointers) to arrays of bytes. KMT_MTM_VALUES is a union type allowing a variety of different types to appear. Note that WORD is a 32-bit unsigned integer, INT is a 32-bit signed integer; LONG makes it 64 bits. The last option in the union is marked REF()REF()BYTE, which means it is a pointer to an array whose members are pointers to arrays of bytes. The final type declared here is a STRUCT, specifically a tuple containing two integers. The program continues by declaring external procedures on which the module depends. RESPONSE indicates a return value containing error information:
EXT PROC (RESPONSE) KMT_UI; EXT PROC (REF INT,INT,RESPONSE) KMT_PH; EXT PROC (REF INT,REF INT,RESPONSE) KMT_PP_GET_PACKET, PROC (INT,INT,BOOL,RESPONSE) KMT_PP_SEND_PACKET, PROC (REF()BYTE,RESPONSE) KMT_PP_BUILD_STRING_PACKET_DATA; and also some external variables:
EXT REF () BYTE KMT_VERSION; EXT REF BOOL ASG_ROUTE; EXT REF()KMT_MTM_VALUES KMT_MTM_AREA; EXT REF()BYTE MTM_TEXT; EXT REF INT MTM_TEXT_LEN; EXT REF ()REF ()BYTE MTM_RECALL_DATA; The rest of the program consists of a number of procedure definitions. One of these, which actually defines the entry point to the program, is reproduced here:
… excerpt ends here. Continue reading the full article.