A man, a PLAN, whatever

The assembly language for the ICL 1900 series was known as PLAN (Programming Language for All Ninteen-hundreds). It came in various variants, cumulating in PLAN4.

PLAN is a fairly horrid assembler, with poor syntax and limited features. It uses a fixed format layout, designed for 80 column punch cards.

Another assembler, GIN, was used for developing George and EXEC. It was freer in format, had better macro facilities and conditional compilation. Unfortunately it is pretty specific to writing George (although some user level programs were written in GIN, sometimes in the expectation that they would later be rewritten to be part of George). One notable limitation of GIN is that it generates programs directlty rather than producing "semicompiled" output suitable for processing by the consolidator (linker).

Yet another assembler for the ICL 1900 was PLASYD, which was inspired by Wirths PL/360. The PLASYD compiler has been found and documentation is available on the ICL 1900 site. The ATLAS Computing LAB seemed to have been great fans of PLASYD.

Anyway, here are some notes about using PLAN

Source code format

Each line of plan is divided into 5 fields:
  1. A six character label field
  2. A six character operation field
  3. A three character accumulator (register) field
  4. A 57 character operand field
  5. An 8 character sequence field
For example:
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890

LABEL LDN   2  'FDTABLE'            [ GET ADDR OF FTABLE

All of these fields are used in instruction sequences, but PLAN compiler directives use the label field (stretching into the operation and accumulator fields if necessary) and the operand field.

Comments

Comments in PLAN could be written anywhere in the operand field, preceded by a "[" as in the example above, or written as a special comment directive consisting of just "#" at the start of the line and the comment in the operand field, i.e. the rest of the label, operation and accumulator fields must be blank. If the comment stretches into the sequence field a "P" error will be flagged.
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890

#              THIS IS A COMMENT.  THE COMMENT TEXT STARTS AS FAR TO
#              THE LEFT AS IT CAN GO. AND AS FAR INTO THE RIGHT AS WE
#              CAN GET WITHOUT FLAGGING ERRORS.

               [ THIS IS A COMMENT TOO, BUT PLAN WILL OUTPUT ZEROES HERE!
               [ AND FLAG THE LINES WITH A "P" ERROR AS THEY STRAY INTO THE
               [ SEQUENCE FIELD.

LABEL LDN   2  'FDTABLE'         [ A SIMPLE COMMENT ON AN INSTRUCTION

Beware! using the "[" syntax on an otherwise empty line causes PLAN to output a zero word, which is probably not what you want. (Note that an all zero word is not a no-op (NULL) on the 1900, it is LDX 0 0 - Load register 0 with contents of word at address 0, which happens to be register 0. One might naïvely think that that was a no-op but LDX adds the carry register to the destination, so LDX 0 0 actualy does X0 = X0 + carry, clear carry.

Code labels

As the label field is 6 chars wide code labels are limited to 5 characters. Putting a longer label on a line by itself appears to work, but in fact produces a data label pointing to a zero word.
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890

#              ATTEMPT TO USE A LONG LABEL

INCORRECT
      LDN   2  'FDTABLE'         [ LABEL "INCORRECT" DOES *NOT* 
      XXX   X  XXXX              [ POINT HERE.

Undefined references

One of the more maddening habits of the PLAN compilers is to automaticaly generate values for undefined references.

If you forget to define a symbol that is used in a data reference (or if you make a typo) the PLAN compiler will allocate a word of lower variable memory for it.

#DEFINE TAB=9          [ This is what I want
      ...
      LDN   2  TBA     [ typo. wanted to put 9 in X2
Instead of complaining on the line referencing the undefined symbol "TBA" the PLAN compiler will pretend you wrote:
#LOWER
               TBA     [ allocate 1 word of lower variable memory
#PROGRAM
      ...
      LDN   2  TBA     [ put address of TBA in X2
In a similar fashion if you reference a code location that is not defined PLAN will assume it's an external reference. (In fact PLAN has no way of explicitly declaring an external reference).

You will only be informed of your error at consolidation time.

Macros, conditional compilation, includes and so on

PLAN has very limited macro facilities: There is no conditional compilation.

There is no include facility.