NORD PL: Difference between revisions

From NDWiki
Jump to navigation Jump to search
m (Move to new category)
m (→‎Sources: a paper from CERN mentions NORD-PL)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''NORD PL''' ('''NORD''' '''P'''rogramming '''L'''anguage, also known as ''NPL'') is a programming language from [[Norsk Data]]. It shipped as a standard component of the operating system [[SINTRAN III]].
'''NORD PL''' ('''NORD''' '''P'''rogramming '''L'''anguage, or '''''NPL''''' ) is a programming language from [[Norsk Data]]. It shipped as a standard component of the operating system [[SINTRAN III]]. It could also run freestanding, or under [[NORD-TSS]].


The language was also used to implement SINTRAN III. I.e. the core and file system of SINTRAN III was written in NORD PL. The NORD PL compiler was also written in NORD PL and some core applications was early on written in NORD PL until [[PLANC]] came and linker and other software was rewritten in PLANC.
The language was also used to implement SINTRAN III. The NORD PL compiler was also written in NORD PL and some core applications was early on written in NORD PL until [[PLANC]] came and linker and other software was rewritten in PLANC.


The NORD PL compiler was also special in that it did not produce object code as most compilers do. Instead it produced assembler code which then had to be assembled using the [[MAC]] assembler.
A quote from the NORD PL Users Guide, July 77, "important advice to the NORD PL programmer":


== Example code ==
''NORD PL is not a problem oriented high level language like FORTRAN or COBOL. It is a machine oriented medium level language introduced to simplify the assembly coding, i.e., in any statement written the programmer should call attention to the influence oon the register contents!''
The registers of the CPU was available in NORD PL as predefined variables. Thus you could write:
 
The NORD PL compiler produced [[MAC]] assembly code which then had to be assembled using the [[MAC]] assembler. The syntax resembles [[wikipedia:ALGOL|ALGOL]], but it was used like an assembler because all instructions, addressing modes, registers, and memory could be accessed from the language. Compared to writing assembly (MAC) directly, the intention was to make it easier to write code and to improve error checking and readability. At the same time, using NORD PL produces code about as if assembly was used directly, unlike if a more traditional systems language (e.g. C) is used.
 
== Properties ==
* Conditional compiling
* Declaration statements
* Arithmetical statements
* Constant expressions, evaluated at compile time
* Control statments, including:
:GO unconditional branching
:IF conditional branching
:FOR loop control
:WHILE conditional loop control
:CALL subroutine call
* One pass compiler
* The compiler needs about 6.5Kwords of memory, plus symbol table (5 words per symbol)
 
I/O must be performed via monitor calls as when writing MAC directly.
==Example code==
 
The registers of the CPU were available in NORD PL as predefined variables. Thus you could write:


  X + T =: A
  X + T =: A
Line 15: Line 35:
  RADD ST DA
  RADD ST DA


Functions could be declared with multiple entry points:
Functions could be declared with multiple entry points (the stand-alone colons represent 'your code goes here'):
 
SUBR ENT1, ENT2
ENT1:
T := 1
:
:
ENT2:
:
EXIT
RBUS
''(RBUS is SUBR backwards, and marks the end of the subroutine/function)''


FUNC FUN1, FUN2
Here you could either call ENT1 which set T to 1 before falling into ENT2 or you could set T to something else and call ENT2. If the T register specified which file handle to write to you could then either call ENT1 to always output to terminal or you could specify a file handle yourself in T and call ENT2 to output to that file.
FUN1: T := 1
FUN2:
code here
END


Here you could either call FUN1 which set T to 1 before falling into FUN2 or you could set T to something else and call FUN2. If T register specified which file handle to write to you could then either call FUN1 to always output to terminal or you could specify a file handle yourself in T and call FUN2 to output to that file.
== Product number ==
NPL is part of [[:Category:ND-210400|ND-210400]] Subsystem package II.


==Sources==
==Sources==
*{{OriginWP-EN|NORD Programming Language|18 December 2008}}  
*{{OriginWP-EN|NORD Programming Language|18 December 2008}}, but has been updated, extended, and corrected since then.
* {{ND-doc|60.047.01}}, first printing, printed August 1973
*{{ND-doc|60.047.03}}
*{{ND-doc|60.047.03}}
* [https://dl.acm.org/doi/abs/10.1145/800218.806638 Structured design benefits to a process control software project - usage of NORD PL]


[[Category:Norsk Data software]]
[[Category:Norsk Data software]]
[[Category:Programming Languages]]

Latest revision as of 18:53, 4 April 2020

NORD PL (NORD Programming Language, or NPL ) is a programming language from Norsk Data. It shipped as a standard component of the operating system SINTRAN III. It could also run freestanding, or under NORD-TSS.

The language was also used to implement SINTRAN III. The NORD PL compiler was also written in NORD PL and some core applications was early on written in NORD PL until PLANC came and linker and other software was rewritten in PLANC.

A quote from the NORD PL Users Guide, July 77, "important advice to the NORD PL programmer":

NORD PL is not a problem oriented high level language like FORTRAN or COBOL. It is a machine oriented medium level language introduced to simplify the assembly coding, i.e., in any statement written the programmer should call attention to the influence oon the register contents!

The NORD PL compiler produced MAC assembly code which then had to be assembled using the MAC assembler. The syntax resembles ALGOL, but it was used like an assembler because all instructions, addressing modes, registers, and memory could be accessed from the language. Compared to writing assembly (MAC) directly, the intention was to make it easier to write code and to improve error checking and readability. At the same time, using NORD PL produces code about as if assembly was used directly, unlike if a more traditional systems language (e.g. C) is used.

Properties

  • Conditional compiling
  • Declaration statements
  • Arithmetical statements
  • Constant expressions, evaluated at compile time
  • Control statments, including:
GO unconditional branching
IF conditional branching
FOR loop control
WHILE conditional loop control
CALL subroutine call
  • One pass compiler
  • The compiler needs about 6.5Kwords of memory, plus symbol table (5 words per symbol)

I/O must be performed via monitor calls as when writing MAC directly.

Example code

The registers of the CPU were available in NORD PL as predefined variables. Thus you could write:

X + T =: A

and the compiler would generate:

COPY SX DA
RADD ST DA

Functions could be declared with multiple entry points (the stand-alone colons represent 'your code goes here'):

SUBR ENT1, ENT2
ENT1:
T := 1
:
:
ENT2:
: 
EXIT
RBUS

(RBUS is SUBR backwards, and marks the end of the subroutine/function)

Here you could either call ENT1 which set T to 1 before falling into ENT2 or you could set T to something else and call ENT2. If the T register specified which file handle to write to you could then either call ENT1 to always output to terminal or you could specify a file handle yourself in T and call ENT2 to output to that file.

Product number

NPL is part of ND-210400 Subsystem package II.

Sources