5. BASIC COMPONENTS OF A PLAN PROGRAM

The following section deals with the compilation of PLAN sources through C.ConPLAN. For the purpose of this description, PLAN statements will be divided up into three categories:

Directives control PLAN assembler
Data Definitions build the program skeleton
Machine Instructions and Macros implement the program logic


 
5.1 PLAN Directives

Directives provide control information for the PLAN Assembler but do not produce any code themselves. All directives begin with the character # in col. 1 of the PLAN statement. Directives which do not need to be converted are turned into ASSEMBF comment by replacing # with * (asterisk). The latter also applies to ICL comment lines which begin with # and are followed by SPACE. PLAN Directives interpreted by ConPLAN are:

PLAN ConPLAN  

#CUE

DS  0H

The #CUE-name becomes an internal address label.

#DEFINE

EQU

#DEFINE is compatible with EQU.

#ENTRY

ENTRY#n  DS  0H

Defines a symbolic address whereby the operand of the #ENTRY statement becomes n. #ENTRY with operand 0 becomes the start address of the program.

#LOWER

 

 

not converted; #LOWER controls the ConPLAN run. #LOWER will be followed by data definitions which are converted. It is recommended that a program version number be stored as the first word of the data storage area (word address 45). If stored, the emulator run-time system will display it with the program start message. If used, the following format must be adhered to:
4HVnnn   where nnn is a 3-digit decimal number. The first character V is the version number indicator. If missing, V### will be displayed instead of a version number.

#MONIT

TERMJ

The program (and Job) will be terminated. #MONIT calls are not removed by ConPLAN, as they will be followed by data definitions which would have to be removed too. All #MONIT directives plus associated data should be eliminated in the PLAN original (for program testing, IDA/AID and $AID can be used).

#PAGE

EJECT

#PAGE is fully compatible with EJECT.

#PROGRAM

 

 

No conversion required

#UPPER

  

 

same as #LOWER. ConPLAN does not distinguish between #LOWER and #UPPER data areas. The full ICL compact-mode address range is implemented as one 96 KB data area.

 
 
5.2 PLAN Data Definitions

As mentioned before, the  objective of the emulation is to  create and maintain a bit-true copy of the original ICL data segment in BS2000 virtual memory. By implication, all ConPLAN data definitions are therefore fully compatible with PLAN. 
Data elements can be assigned labels which, unlike those in the coding segment, can consist of up to 11 characters; after the ConPLAN compilation only the first 8 characters will be significant - it is thus important that all labels differ in their first 8 characters. The following breakdown shows the main data types handled by ConPLAN.
 

Storage Definitions

 PLAN ConPLAN
         1         2
123456789012345678901234...
               WORD1
               ARRAY(n)
         1         2         3         4
12345678901234567890123456789012345678901234567...


 

Constant Definitions

 PLAN ConPLAN
         1         2
123456789012345678901234...

Decimal Integers:
LABL1          n
LABL2          -n

Unsigned Octal Integers:
LABL3          #n

Characters:
LABL4          nHc

Index Words:
LABL5          n/addr

Character Index Words:
LABL6          n/addr.c
         1         2         3         4
12345678901234567890123456789012345678901234567...


LABL1    DC    FL3'n'
LABL2    DC    FL3'-n'


LABL3    DC    AL3(X'h')  n->h (calc. by ConPLAN)


LABL4    DC    XLb'h'     b = INT(n/4*3)
                          char.c -> hex.h

LABL5    DC    AL3(n*X'8000'+addr+0)


LABL6    DC    AL3(n*X'8000'+addr+c*X'40000')

 
 
5.3 PLAN Instructions

A detailed description of the emulated PLAN instructions can be found in chapters 6 and 7 of the printed ConPLAN manual. ConPLAN handles all instructions and macro calls in a strictly formalized way and leaves any special treatment to the emulator macro $PLAN.
 

The elements of a PLAN instruction or macro become $PLAN macro operands O1...On:


 Column

 PLAN
 ConPLAN 

         1         2         3         4         5         6
123456789012345678901234567890123456789012345678901234567890123

label instr    x yzop1, op2,...,opn
label    $PLAN instr, X1=x,X2=y,X3=z, O1=op1,O2=op2,...,On=opn


 
Conversion of a typical PLAN macro (e.g. sequential file definition SDDEF):


 Column

 PLAN
 ConPLAN

         1         2         3         4         5         6
123456789012345678901234567890123456789012345678901234567890123

FILE1 SDDEF 1  2,512,FDA,EXCPT,1     
FILE1    $PLAN SDDEF,X1=1,O1=2,O2=512,O3=FDA,O4=EXCPT,O5=1