P800 Simulation: The RTL/2 programming language

Home
Back

RTL/2 was developed in the early seventies by ICI in the UK (ICI=Imperial Chemical Industries Ltd, since 2008 taken over by AkzoNobel) as a high-level language for process control applications and systems programming for (at that time) small computers. Those applications were mainly programmed at that time in assembly language and the industry was looking for methods to increase programmer productivity and program portability. Replacing the assembler by a higher level programming language for program development, which still was able to produce efficient code for a small computer, was a popular research topic. The development of RTL/2 was one of the results of those efforts.

RTL/2 was available for the various mini and larger computers (e.g. the Digital PDP11 and VAX) and also for the Philips P800. Compilers were made to run either under DOS or MAS.

RTL/2 running under MAS

In the picture above the line printer window shows a simple "hello world" RTL/2 program just to show the compilation, link and execution of an RTL/2 program.

Define and start the Background Machine (MAS rel. 9 -- P85x under Windows 7.1)
==============================================================================

MACH-ID: SYSTEM DATE : 04/ 04/ 17
:JOB SYSTEM
%%BMS
DCB 16
FCD /C0
FCD /F0,/C0,SUPERV
FCD /F1,/C0,TCE
FCD /F2,/C0,MAS900
FCD 1,TY08
FCD 2,LP07
FCD 3,PR20
FCD /E0,TY08
FCD /E1,TY08
DEN
BYE BATCH

Start a Batch session
=====================

:JOB THEO

DATE :APR 04 17 // TIME : 20H.47M.00S.

** BCP RELEASE 9.0 85-10-08
LIB

DATE :APR 04 17 // TIME : 20H.47M.00S.
LIBRARIAN REL 09 (12 12 85)
PRD

LABEL = MAS900-1 TCE     DATE = 05 10 99 80M PACK NBR = 0009

DAD  TCE        LIBRARY DIRECTORY OF USER  THEO

FILE NAME   TYPE  VERS   DATE    ADDR   ORG           ATTRIBUTES

SQRT         LM     0  16 02 17  0020   NC              SH
TSQRT2       SC     0  16 02 17  0018   NC              SH
STOP         SC     0  24 03 17  0040   NC              SH
STOP         LM     0  24 03 17  0050   NC              SH
LDT04        SC     0  21 02 17  01B8   NC              SH
LDT04        LM     0  21 02 17  00B0   NC              SH

Read the source of the "hello world" RTL/2 program from papertape to disk
=========================================================================

ASG 3,PR20
ASG /10,TYPE=SC
CSF INAM=3,ONAM=/10
KPF /10,TYPE=SC,FNAM=HELLO
PRD

LABEL = MAS900-1 TCE     DATE = 05 10 99 80M PACK NBR = 0009

DAD  TCE        LIBRARY DIRECTORY OF USER  THEO

FILE NAME   TYPE  VERS   DATE    ADDR   ORG           ATTRIBUTES

SQRT         LM     0  16 02 17  0020   NC              SH
TSQRT2       SC     0  16 02 17  0018   NC              SH
STOP         SC     0  24 03 17  0040   NC              SH
STOP         LM     0  24 03 17  0050   NC              SH
HELLO        SC     0  04 04 17  0010   NC              SH
LDT04        SC     0  21 02 17  01B8   NC              SH
LDT04        LM     0  21 02 17  00B0   NC              SH

Print the RTL/2 source
======================
PRF HELLO,TYPE=SC

000000 IDENT HELLO
000001 TITLE HELLO WORLD;
000002 LET NL=10;
000003 LET FF=12;
000004 SVC DATA RRSIO;
000005  PROC() BYTE IN;
000006  PROC(BYTE) OUT;
000007 ENDDATA;
000008 EXT PROC(REF ARRAY BYTE) TWRT;
000009 EXT PROC (INT) PROC (BYTE) RROPO,RROPOS;
000010 EXT PROC (PROC (BYTE)) RRCLSO;
000011
000012 ENT PROC RRJOB() INT;
000013 PROC(BYTE) TYOUT:=RROPOS(1),LPOUT:=RROPO(2);
000014 OUT:=LPOUT;
000015 OUT(FF);
000016 TWRT ("HELLO WORLD 1#NL#");
000017 OUT:=TYOUT;
000018 TWRT ("HELLO WORLD 2#NL#");
000019 RRCLSO(TYOUT);
000020 RRCLSO(LPOUT);
000021 RETURN(1);
000022 ENDPROC;

Compile the program (%% RTLD catalogued procedure is used)
==========================================================

%%RTLD F1,THEO,HELLO,SC
ASG FCOD=/D4,FNAM=HELLO,DAD=/F1,TYPE=SC,USID=THEO,WPRO=YES,VERS=0
ASG FCOD=/BF,TYPE=SC,NBGR=1,CONS=NO,DAD=/F1
ASG FCOD=/BD,TYPE=UF,NBGR=1,CONS=NO,DAD=/F1
ASG FCOD=/BE,TYPE=UF,NBGR=1,CONS=NO,DAD=/F1
RTL DUMP=NO

DATE :APR 04 17 // TIME : 20H.47M.00S.

RTL/2 PHILIPS P800 - S.P.L. 1.04-8701 352 81040-80/03/17-NLHA

0 IDENT HELLO
1 TITLE HELLO WORLD;
2 LET NL=10;
3 LET FF=12;
4 SVC DATA RRSIO;
5  PROC() BYTE IN;
6  PROC(BYTE) OUT;
7 ENDDATA;
8 EXT PROC(REF ARRAY BYTE) TWRT;
9 EXT PROC (INT) PROC (BYTE) RROPO,RROPOS;
10 EXT PROC (PROC (BYTE)) RRCLSO;
11
12 ENT PROC RRJOB() INT;
13 PROC(BYTE) TYOUT:=RROPOS(1),LPOUT:=RROPO(2);
14 OUT:=LPOUT;
15 OUT(FF);
16 TWRT ("HELLO WORLD 1#NL#");
17 OUT:=TYOUT;
18 TWRT ("HELLO WORLD 2#NL#");
19 RRCLSO(TYOUT);
20 RRCLSO(LPOUT);
21 RETURN(1);
22 ENDPROC;

** COMPILED AS SYSTEMS MODULE **

**FRONTEND MESSAGES**

*WARNING MESSAGES*

ON LINE  AT SYMBOL   LAST IDENTIFIER                  NO.  ERROR MESSAGE

     14  ;           LPOUT                            201  TAKING OUT OF SCOPE ?

     17  ;           TYOUT                            201  TAKING OUT OF SCOPE ?

THE FOLLOWING IDENTIFIERS HAVE NOT BEEN REFERENCED :

IN IN RRSIO
**

 

*USE OF RESOURCES*

RESOURCE            MAX   USED

IDENTIFIERS         400     12
AT BRICK LEVEL      250      8
IDENTIFIER NAMES    250     12
NAME CHARACTERS    1500     50
GENERATED LABELS  32367      0
CONSTANT POOL      1000      7
STRING POOL        3000     34
ARRAY BOUNDS         50      0
MODE INFORMATION    500     42

 

*IDENTIFIER CONCORDANCE*

LINE OF SPECIFICATION OF EXT NAMES, MODES AND COMPONENTS NOT INCLUDED

IDENTIFIER       : LINE NUMBERS

FF               : *ILL DEFINED OR REPLACED LET NAME*
IN IN RRSIO      : NOT USED
LPOUT IN RRJOB   :    13    14    20
NL               : *ILL DEFINED OR REPLACED LET NAME*
OUT IN RRSIO     :    14    15    17
RRCLSO           :    19    20
RRJOB            :    12
RROPO            :    13
RROPOS           :    13
RRSIO            : NOT USED
TWRT             :    16    18
TYOUT IN RRJOB   :    13    17    19

**

 

BRICKL     SIZE   HEX
R:POOL      32    20
R:REAL       0     0
RRJOB      138    8A
'TOTAL'    170    AA

COMPILATION OK

 

:EOF

EXIT CODE= /00
REF FCOD=/BF

Output of the compiler is an assembly source program: assemble
==============================================================

ASM

DATE :APR 04 17 // TIME : 20H.47M.00S.

ASM RELEASE 9.0  851031
OPT PROG=/BF,LIST=YES

00000                           IDENT    HELLO
00001                           ENTRY    RRJOB
00002                           EXTRN    RRSIO,TWRT,RROPO,RROPOS
00003                           EXTRN    RRCLSO
00004                           EXTRN    R:R01,R:R02,R:R03,R:R04,R:R05,R:R06,R:R07,R:R08
00005                           EXTRN    R:R09,R:R10,R:R11,R:R12,R:R13,R:R14,R:R15,R:R16
00006                           EXTRN    R:R17,R:R18,R:R19,R:R20,R:R21,R:R22,R:R23,R:R24
00007                           EXTRN    R:R25,R:R26,R:R27,R:R28
00008                                                          EXT DATA RRSIO
00009                                                             0 IN
00010                                                             2 OUT
00011                  BYPR   FORM       8,8
00012                  R:POOL EQU        *                     STRING POOL
00013  0000  000E               DATA     14
00014  0002  4845               DATA     'HELLO WORLD '
       0004  4C4C
       0006  4F20
       0008  574F
       000A  524C
       000C  4420
00015  000E  310A               BYPR     /31,/A
00016  0010  000E               DATA     14
00017  0012  4845               DATA     'HELLO WORLD '
       0014  4C4C
       0016  4F20
       0018  574F
       001A  524C
       001C  4420
00018  001E  320A               BYPR     /32,/A
00019                  * TITLE   HELLO WORLD;
00020                  * TITLE   HELLO WORLD;
00021                  RRJOB    EQU      *
00022                  * ENT BRICK RRJOB
00023                  R:367    EQU      *
00024                                                             FFFE TYOUT
00025                                                             FFFC LPOUT
00026  0020  F621               CF       A6,R:R01
       0022  0000  X
00027  0024  0007               DATA     7
00028  0026  0401               LDK      A4,/1                    13 CONSTACC
00029  0028  8453               ST       A4,/FFFA,A12             13 DUMPR
       002A  FFFA
00030  002C  8612               LDR      A6,A12                   13 LITCALL RROPOS
00031  002E  1E08               SUK      A6,8
00032  0030  F621               CF       A6,RROPOS
       0032  0000  X
00033  0034  8153               ST       A1,/FFFE,A12             13 STORR TYOUT
       0036  FFFE
00034  0038  0402               LDK      A4,/2                    13 CONSTACC
00035  003A  8453               ST       A4,/FFFA,A12             13 DUMPR
       003C  FFFA
00036  003E  8612               LDR      A6,A12                   13 LITCALL RROPO
00037  0040  1E08               SUK      A6,8
00038  0042  F621               CF       A6,RROPO
       0044  0000  X
00039  0046  8153               ST       A1,/FFFC,A12             14 STRER LPOUT
       0048  FFFC
00040  004A  8157               ST       A1,RRSIO+/2,A13          15 STORR OUT
       004C  0002  X
00041  004E  040C               LDK      A4,/C                    15 CONSTACC
00042  0050  8453               ST       A4,/FFFA,A12             15 DUMPR
       0052  FFFA
00043  0054  8612               LDR      A6,A12                   15 FCALL OUT
00044  0056  1E08               SUK      A6,8
00045  0058  F657               CFI      A6,RRSIO+/2,A13
       005A  0002  X
00046  005C  8420               LDKL     A4,R:POOL+/1             16 ACCESS
       005E  0001  R
00047  0060  8453               ST       A4,/FFFA,A12             16 DUMPR
       0062  FFFA
00048  0064  8612               LDR      A6,A12                   16 LITCALL TWRT
00049  0066  1E08               SUK      A6,8
00050  0068  F621               CF       A6,TWRT
       006A  0000  X
00051  006C  8452               LD       A4,/FFFE,A12             18 FETCH TYOUT
       006E  FFFE
00052  0070  8457               ST       A4,RRSIO+/2,A13          18 STORE OUT
       0072  0002  X
00053  0074  8420               LDKL     A4,R:POOL+/11            18 ACCESS
       0076  0011  R
00054  0078  8453               ST       A4,/FFFA,A12             18 DUMPR
       007A  FFFA
00055  007C  8612               LDR      A6,A12                   18 LITCALL TWRT
00056  007E  1E08               SUK      A6,8
00057  0080  F621               CF       A6,TWRT
       0082  0000  X
00058  0084  8452               LD       A4,/FFFE,A12             19 FETCH TYOUT
       0086  FFFE
00059  0088  8453               ST       A4,/FFFA,A12             19 DUMPR
       008A  FFFA
00060  008C  8612               LDR      A6,A12                   19 LITCALL RRCLSO
00061  008E  1E08               SUK      A6,8
00062  0090  F621               CF       A6,RRCLSO
       0092  0000  X
00063  0094  8452               LD       A4,/FFFC,A12             20 FETCH LPOUT
       0096  FFFC
00064  0098  8453               ST       A4,/FFFA,A12             20 DUMPR
       009A  FFFA
00065  009C  8612               LDR      A6,A12                   20 LITCALL RRCLSO
00066  009E  1E08               SUK      A6,8
00067  00A0  F621               CF       A6,RRCLSO
       00A2  0000  X
00068  00A4  0101               LDK      A1,/1                    22 ACCR
00069  00A6  8F20               ABL      R:R02
       00A8  0000  X
00070                  * USES : RROPOS,RROPO,TWRT,RRCLSO
00071                           END

 

 

SYMBOL TABLE

RRJOB   0020  R   RRSIO         X   TWRT          X   RROPO         X
RROPOS        X   RRCLSO        X   R:R01         X   R:R02         X
R:R03         X   R:R04         X   R:R05         X   R:R06         X
R:R07         X   R:R08         X   R:R09         X   R:R10         X
R:R11         X   R:R12         X   R:R13         X   R:R14         X
R:R15         X   R:R16         X   R:R17         X   R:R18         X
R:R19         X   R:R20         X   R:R21         X   R:R22         X
R:R23         X   R:R24         X   R:R25         X   R:R26         X
R:R27         X   R:R28         X   R:POOL  0000  R   R:367   0020  R

ASS.ERR.    00000

:EOF

EXIT CODE= /00
LIB

DATE :APR 04 17 // TIME : 20H.47M.00S.
LIBRARIAN REL 09 (12 12 85)
LEN

EXIT CODE= /00
SCR FCOD=/BF %
SCR FCOD=/BF
SCR FCOD=/BE
SCR FCOD=/BD
SCR FCOD=/D4
PEND

Save the object module as created by the assembler
==================================================

LIB

DATE :APR 04 17 // TIME : 20H.47M.00S.
LIBRARIAN REL 09 (12 12 85)
KOM DAD=/F1,USID=THEO,FCOD=/D5,LIBR=HELLO
PRD

LABEL =  MAS900-1 TCE     DATE =  05  10  99  80M PACK NBR =  0009

DAD  TCE        LIBRARY DIRECTORY OF USER  THEO

FILE NAME   TYPE  VERS   DATE    ADDR   ORG          ATTRIBUTES
SQRT         LM     0  16 02 17  0020   NC              SH
TSQRT2       SC     0  16 02 17  0018   NC              SH
STOP         SC     0  24 03 17  0040   NC              SH
STOP         LM     0  24 03 17  0050   NC              SH
HELLO        SC     0  04 04 17  0010   NC              SH <<== source
LDT04        SC     0  21 02 17  01B8   NC              SH
LDT04        LM     0  21 02 17  00B0   NC              SH
HELLO        OB     0  04 04 17  0028   NC              SH <<== object

LEN

EXIT CODE= /00
SCR /D5

Link the program
================

INC LIBR=RTLLIB,MNAM=RRBPGA,USID=MASUP;  <<== base program
INC LIBR=HELLO,USID=THEO,DAD=/F1
LKE

DATE :APR 04 17 // TIME : 20H.47M.00S.
OVERLAY LINKAGE EDITOR  REL 09.00 (31 10 85)
OPT STAD=RRSTR,CATL=HELLO,MAP=YES,SLIB=RTLLIB

START = 000C    LENGTH =2DB4    REGION =2F1E

 

***   OVERLAY STRUCTURE   ***

***   LEVEL #    0   ***

SEGMENT # 00      ADDRESS = 0008   SECTOR # 0000  ASCENDANT # FF

RRBPGA  0008      HELLO   0018      RTLR01  00C2      SLRTW   00FA
RRSIO   013A      RRBPGB  0F7A      RTLR00  2D36      RTLR09  2D4A
RRBUFF  2D6E

***   SYMBOL TABLE   ***

A 00 0000 F:FCT   E 00 2D36 R:R00   E 00 00C2 R:R01   E 00 00F2 R:R02
E 00 2D4A R:R09   E 00 2D64 R:R10   A 00 000C RRACTV  A 00 0017 RRASG
A 00 000E RRATDE  E 00 2BA4 RRBPUB  A 00 001A RRCANR  E 00 0D72 RRCLSI
E 00 0DC6 RRCLSO  A 00 0007 RRCNAB  A 00 0014 RRCNLE  A 00 000A RRCNTI
A 00 0015 RRDCLE  A 00 000B RRDCTI  A 00 0018 RRDEL   A 00 000F RRDTDE
A 00 000E RRERR   A 00 0018 RRERRX  A 00 0012 RREVEN  A 00 0003 RREXIT
E 00 2D6E RRGBF   E 00 2A54 RRGEL   A 00 001A RRIODT  A 00 0001 RRIOLK
E 00 2CFA RRIPF   E 00 0038 RRJOB   A 00 0009 RRLDSE  E 00 2D2C RRNUL
E 00 2D14 RROPF   E 00 01B0 RROPI   A 00 0019 RROPMS  E 00 01F6 RROPO
E 00 0234 RROPOS  E 00 0BE2 RRORDI  E 00 0C98 RRORDO  A 00 0006 RRPAUS
E 00 2DA0 RRRBF   A 00 0006 RRSED   A 00 0002 RRSIO   A 00 0008 RRSTK
E 00 000C RRSTR   A 00 000D RRSWIT  A 00 0011 RRTIME  A 00 0002 RRWAIT
A 00 0016 RRWTIM  E 00 00FA TWRT    A 00 0000 W:FCT

:EOF

EXIT CODE= /00
LIB

DATE :APR 04 17 // TIME : 20H.47M.00S.
LIBRARIAN REL 09 (12 12 85)
PRD

LABEL =  MAS900-1 TCE     DATE =  05  10  99  80M PACK NBR =  0009

DAD  TCE        LIBRARY DIRECTORY OF USER  THEO

FILE NAME   TYPE  VERS   DATE    ADDR   ORG          ATTRIBUTES

SQRT         LM     0  16 02 17  0020   NC               SH
TSQRT2       SC     0  16 02 17  0018   NC               SH
STOP         SC     0  24 03 17  0040   NC               SH
STOP         LM     0  24 03 17  0050   NC               SH
HELLO        SC     0  04 04 17  0010   NC               SH <<== source
LDT04        SC     0  21 02 17  01B8   NC               SH
LDT04        LM     0  21 02 17  00B0   NC               SH
HELLO        OB     0  04 04 17  0028   NC               SH <<== object
HELLO        LM     0  04 04 17  0060   NC               SH <<== load module

LEN

EXIT CODE= /00

And run the program
===================

RUN HELLO

DATE :APR 04 17 // TIME : 20H.47M.00S.

 

HELLO WORLD 1        <<<<<======= output (the other printed line is on the console)

:EOF

EXIT CODE= /00

ELAPSED TIME =000001 PRINTED RECORDS =000004 PUNCHED RECORDS =000000


RTL/2 documentation

RTL/2 introduction

RTL/2 language specification

RTL/2 user manual P800

RTL/2 standard stream IO

RTL/2 release 2, P800

RTL/2 P800 runtime environment

RTL/2 Fortran interface, P800

RTL/2 Training Manual part 1

RTL/2 Training Manual part 2

RTL/2 Training Manual part 3

 top


 

Page last updated on: April 11 2017 | Contact: Info@theoengel.nl