PLUS - Introduction

The PLUS language holds a special place in the history of MTS - let’s look at it in more detail.

PLUS

PLUS was created by Alan Ballard and Paul Whaley of the University of British Columbia in the 1970s, based on language work done for a previous experimental OS called SUE. According to the HELP pages for PLUS:

PLUS is superficially quite different from Sue or Pascal; however the underlying language semantics are really very similar. Users familiar with the programming language C will also recognize much of its structure and semantics in PLUS.

PLUS on MTS

PLUS was used heavily at MTS sites as a system development language, as it provides a structured programming environment easier to use than lower level languages, while still allowing access to machine level features in a way a more generic language such as Pascal did not. The implementation also came with a large source library that made writing complex programs easier. It could generate object code both for the System/360 and both PDP/11 and Motorola 68000 systems.

The compiler was written in PLUS and the source can be found on the distribution tapes under component 1042.

Prerequisites

No special installation instructions to get this language running - just do the standard D6.0 setup as described in this guide and then sign on as a regular user such as ST01.

Compiling and running a program

The *PLUS compiler takes its input from scards and writes output to spunch, like many other language translators.

$run *PLUS scards=hello.plus spunch=-load

Hello world

Let’s show this in action. Assume we have a program in the file hello.plus, let’s look how we’d list, compile and run it.

# $list hello.plus

      1     %Title := "Hello World Program";
      2
      3     %Include(Sprint_String, Main);
      4
      5     definition Main;
      6       variable Count is Integer;
      7       do Count := 1 to 5
      8         Sprint_String("Hello, world!");
      9       end do;
     10     end Main;


# $run *plus scards=hello.plus spunch=-load
# Execution begins   07:26:15


 Hello World Program                                                                User REL.   Fri May  3/19 07:26:16     Page    1


      1.       1 |%Include(Sprint_String, Main);                                                               hello.plus

 No messages for global String_Types.
 Global size 0 bytes.

 No messages for global Numeric_Types.
 Global size 0 bytes.

                   ****************************************************************************************
                   *                                                                                      *
                   *  procedure Main                                                                      *
                   *     parameter is Par (ref).                                                          *
                   *     result is Rc.                                                                    *
                   *     external name is "MAIN    ".                                                     *
                   *                                                                                      *
                   ****************************************************************************************

  24810.       1 |definition Main;
      6.       2 |   variable Count is Integer;
      7.       3 |   do Count := 1 to 5
      8.       1 |      Sprint_String("Hello, world!");
      9.      25 |   end do;
     10.      26 |end Main;

 No messages for procedure Main.
 215 bytes code generated; 424 bytes stack required.

 String_Types   Numeric_Types   Main   Mts_Io_Types   Main                                                                 Page    1


 Plus/370 Compilation -- University of Michigan -- Version 28/16                    User REL.   Fri May  3/19 07:26:16     Page    2

                                                   C r o s s    R e f e r e n c e

       +------------------------------------------------+             Sprint_String         macro       1:8       1:4
       | References are of form   page:coordinate,...   |             Sprint_Varying        macro       1:7       1:7
       |                                                |             Standard_String_Length
       | Codes used are:                                |                                   constant    1:2       1:3,4,5
       |    D - procedure definition                    |             Str                   macro parm  1:8       1:23,24
       |    S - store reference                         |             Str                   macro parm  1:9       1:6
       |    @ - pointer dereferenced                    |             String_Length_Type    type        1:3       1:8
       |    A - address taken                           |             String_Types          global      1:1
       |    E - equated or opened                       |             Transmitted_Length    field       1:8
       |                                                |             Varying_String        type        1:5       1:5
       | *  indicates procedures and globals with errors|             Varying_String_Length field       1:8
       +------------------------------------------------+             Varying_String_Structure_Type
                                                                                            type        1:6
 +-------------------------------------------------------------+      Varying_String_Text   field       1:9
 |   Symbol                Usage      Decl      References     |
 +-------------------------------------------------------------+

   Actual_Length         field       1:8
   Buff                  parameter   1:15
   Count                 variable    1:2       1:3S
   Fdub                  field       1:17
   Fixed_String          type        1:4       1:9
   Integer               type        1:6       1:15,2,19
   Len                   parameter   1:16
   Len                   variable    1:22      1:23S,24A
   Line                  variable    1:5       1:6S,23,24A
   Lio_Number            field       1:19
   Liounit               field       1:15
   Lnum                  parameter   1:18
   Main                  procedure   1:17      1:1D
   Main_Procedure_Type   type        1:12      1:17
   Maximum_Integer       constant    1:4       1:5,6
   Maximum_Length        field       1:8
   Maximum_Short_Integer constant    1:2       1:3,7
   Minimum_Integer       constant    1:5       1:6
   Minimum_Short_Integer constant    1:3       1:7
   Mods                  parameter   1:17
   Mts_Fdub_Kind         constant    1:10      1:16
   Mts_Fdub_Type         type        1:2       1:17
   Mts_Io_Extended_Modifiers_Type
                         type        1:5
   Mts_Io_Length_Type    type        1:6
   Mts_Io_Modifiers_Type type        1:4
   Mts_Io_Types          global      1:1
   Mts_Io_Unit_Type      type        1:11
   Mts_Line_Number_Type  type        1:3       1:18
   Mts_Lio_Number_Kind   constant    1:10      1:18
   Mts_Liounit_Kind      constant    1:10      1:14
   Mts_Unit_Kind_Type    type        1:10      1:13
   Notification          result      1:19
   Numeric_Types         global      1:1
   Par                   parameter   1:14
   Rc                    result      1:15
   Short_Integer         type        1:7       1:8,16,22
   Sprint                procedure   1:21      1:24
   Sprint_Procedure_Type type        1:13      1:21


                                                                                                                           Page    2


 Plus/370 Compilation -- University of Michigan -- Version 28/16                    User REL.   Fri May  3/19 07:26:16     Page    3


 The following libraries were specified for this compilation:

   *PLUS.SOURCELIB       9 members included.


 Total code generated:             215 (bytes)
 Total warning messages:             0
 Total error messages:               0
# Execution terminated   07:26:15  T=0.075

# $run -load
# Execution begins   07:26:23
 Hello, world!
 Hello, world!
 Hello, world!
 Hello, world!
 Hello, world!
# Execution terminated   07:26:23  T=0.001

In the next article, we’ll look at the features of PLUS in more detail.

Further information

A paper describing Project SUE can be found at the ACM website.

The main language tutorial and reference is at Bitsavers along with the source library reference.

Comments

comments powered by Disqus