3. DESIGN CHARACTERISTICS OF THE CONVERSION SYSTEM

In "compact mode" ICL 1900/2900 instructions incorporate a 12 bit address field which allows application programs to directly address the first 4096 words of memory, the so-called LOWER data area; the instruction code segment begins at word address 4096. Branch instructions within the code segment use 15-bit addresses, thus allowing branches within an address space of 32 KWords. The address space from the end of the code segment up to word address 32767 is called UPPER data area and is only addressable by means of a modifier accumulator which has to be loaded with an address constant (usually a literal) containing a suitable base address. Due to the shortage of accumulators, this is commonly done every time a data item in UPPER space is to be referenced. Within the context of ConPLAN, a distinction between LOWER and UPPER data areas is meaningless, as all data definitions of the PLAN program are collected in one data segment which follows the simulated ICL program header and the ConPLAN work area.

BS2000 registers 0, 3, 4, 5 are used to address the data segment; emulated programs are thus not relocateable. This is important, as PLAN allows programs to refer to accumulators through the absolute word addresses 0-7. The emulator does not pose any restrictions on the code size of converted programs other than the customary limits of the BS2000 virtual user address space. However, the combined size of LOWER and UPPER data areas are restricted to 32 KWords (96 KB) just as with PLAN in order to guarantee the correct emulation of modified addresses. This means that programs written to be executed in ICL "compact mode" will always be correctly addressable after conversion as long as all data is kept in LOWER and UPPER data areas. Parameters (i.e. data) following a "CALL" statement do not meet this condition; they are however exempt from the rule: up to 3 parameters will be branched over on "EXIT" from the targeted subroutine.

The PLAN language is incompatible with ASSEMBF on all levels, beginning with the physical format of the source data (ICL 64 character code stored as 24-bit words on magnetic tape), the syntactical format of data definitions, machine instructions, macros and operating system calls through to the differences at the hardware level of the machine architecture. A step-by-step approach is taken to resolve these incompatibilities at each level.

  • The utility SPIN (SPool-IN), an emulated PLAN program itself, converts ICL program sources (residing on magnetic tape in logical ICL format) into BS2000 SAM files of standard Editor (EDT) format. If the procedure P.SPIN is used to execute it, a code translation from ICL 64 character code to EBCDIC will be automatically performed.
  • The source converter ConPLAN makes the PLAN program syntactically compatible with ASSEMBF. It covers:

    Define Storage, Define Constant (DS, DC). Octal constants as well as character strings are converted to hexadecimal constants with the original definitions being inserted as comment lines.
    Creation of LOWER and UPPER data areas plus coding to make them addressable.
    Generation of coding to make the instruction part addressable.
    Conversion of X-directives (as far as they are relevant in BS2000).
    Conversion of the ICL instruction syntax into an ASSEMBF macro format.
    Generation of address labels for branches relative to the address counter (t-addresses). The variable length (in words) of PLAN instructions or macros to be skipped is taken into account.
     
    Conversion of PLAN macro instructions into calls to ConPLAN run-time routines:

    DISP Display short message upon the terminal
    DISTY Display up to 63 characters (a ConPLAN extension) upon the terminal
    SUSWT Display short message, suspend program and await operator reply or, alternatively, accept a short text string from the terminal (ConPLAN extension)
    SUSTY Display up to 63 characters (ConPLAN extension) upon the terminal, suspend program and await operator reply or, alternatively, accept a short text string from the terminal (ConPLAN extension) 
    DEL Display short message and terminate current program (equivalent to BS2000 macro TERM) 
    DELTY Display message to load successor program and terminate current program (equivalent to BS2000 macro TERM)

    Conversion of I/O functions
    ALLOT

    Allocate device

    PERI

    Physical I/O, implemented for card-reader, line-printer and physical tape input (implemented through macros RDATA, WRLST and BTAM respectively)

    SDDEF

    Define a file

    SDRD

    Read record ( BS2000: "move mode")

    SDRDP

    Read record (BS2000:  "locate mode")

    SDWR

    Write updated record into buffer area

    SDWRI

    Insert new record into buffer area

    SDCLB

    Write buffer area to file (forced physical write)

    SDEND

    Close file


    Flagging of PLAN statements which may require extra attention
  • The emulation macro $PLAN generates ASSEMBF code for the execution of the following PLAN machine instructions:

    Transfer Instructions

    DCH

    Deposit Character

    DSA

    Deposit Short Address

    DLA

    Deposit Long Address

    LDCH

    Load Character

    LDCT

    Load Count

    LDEX

    Load Exponent

    LDN

    Load Direct Operand

    LDSA

    Load Short Address

    LDX

    Load into Accumulator

    MOVE

    Copy a Block of Words

    NGS

    Store Negative Contents of Accumulator 

    NGX

    Load Negative from Store

    STO

    Store Contents of Accumulator

    STOZ

    Store Zero

    NGN

    Load Complement into Accumulator


    Arithmetic Instructions

    ADN

    Add Direct Operand into Accumulator

    ADS

    Add Accumulator into Store

    ADX

    Add into Accumulator

    DVD

    Divide Double Length

    DVR

    Divide and Round

    DVS

    Divide Single-length

    MPA

    Multiply and Add

    MPY

    Multiply

    SBN

    Subtract Direct Operand from Accumulator

    SBS

    Subtract Accumulator from Store

    SBX

    Subtract from Accumulator


    Character Conversion

    CBD

    Convert Binary to Decimal

    CDB

    Convert Decimal to Binary


    Branch Instructions

    BCC

    Branch if C is Clear

    BCT

    Branch if C is Set

    BCHX

    Branch on Character Indexing

    BDX

    Branch on Double Indexing

    BNG

    Branch if Accumulator LT Zero

    BNZ

    Branch if Accumulator NE Zero

    BPZ

    Branch if Accumulator GE Zero

    BRN

    Unconditional Branch

    BXE

    Branch if Accumulator EQ n

    BXGE

    Branch if Accumulator GE n

    BXL

    Branch if Accumulator LT n

    BXU

    Branch if Accumulator NE n

    BZE

    Branch if Accumulator EQ Zero

    CALL

    Branch to Subroutine

    EXIT

    Return from Subroutine


    Logical Instructions

    ANDN

    Logical AND with Direct Operand

    ANDS

    Logical AND into Store

    ANDX

    Logical AND into Accumulator

    ORN

    Logical OR with Direct Operand

    ORS

    Logical OR into Store

    ORX

    Logical OR into Accumulator

    ERN

    Exclusive OR with Direct Operand

    ERS

    Exclusive OR into Store

    ERX

    Exclusive OR into Accumulator

    TXL

    Test Accumulator for Less

    TXU

    Test Accumulator for Unequal


    Shift Instructions

    SLL

    Shift Left Logical

    SRL

    Shift Right Logical

    SLA

    Shift Left Arithmetic

    SRA

    Shift Right Arithmetic

    SLC

    Shift Left Circular

    SRC

    Shift Right Circular


    Miscellaneous Instructions

    NULL

    No Operation

    TEST

    Test Switch

    ON

    Set Switch On

    OFF

    Set Switch Off

    MODE

    Zero Suppression on

    GIVE

    Get Time/Date from Executive

    ASSMF

    Call BS2000 ASSEMBF Module (ConPLAN extension)