         Edinburgh IMP77 Compiler - Version 8.4

    1  %externalstring(255)%fnspec date
    2  %externalstring(255)%fnspec time
    3  %systemroutinespec exit %alias "exit" (%integer rc)
    4  
    5  %externalintegerfnspec cputime
    6  %externalroutinespec getblock %alias "GETBLOCK_JSB" (%integer len, %bytename base)
    7  %externalintegerfunctionspec getlong %alias "GETLONG_JSB"
    8  %externalintegerfunctionspec getword %alias "GETWORD_JSB"
    9     %externalroutinespec get(%integername n)
   10     %externalroutinespec put(%integer n)
   11     %externalroutinespec putword(%integer n)
   12     %externalroutinespec putlong(%integer n)
   13     %externalroutinespec putblock(%integer len, %bytename b)
   14  !   Computer Science IMP77 Compiler   -   Version 8  Third pass
   15  !      23rd March 1981
   16  !      Mods by MT October/November 1981
   17  !
   18  ! Uses common include file defining constants,
   19  ! spec'ing common externals etc.
   20  !
   21  !!%include "control.imp"
   22  
   23  {%systemroutinespec exit %alias "exit" (%integer s)
   24  !%external %routine %spec  PUT (%integer n)
   25  !%external %routine %spec  PUT WORD (%integer n)
   26  !%external %routine %spec  PUT LONG (%integer n)
   27  !%external %routine %spec  PUT BLOCK (%integer n, %bytename b)
   28  %external %routine %spec  SELECT INPUT TANK (%integer n)
   29  %external %routine %spec  SELECT OUTPUT TANK (%integer n)
   30  !%external %routine %spec  GET (%integer %name ch)
   31  !%external %routine %spec  GET BLOCK (%integer len, %byte %name b)
   32  %external %routine %spec  PRINT RECORD (%integer len, %byte %name buff)
   33  %external %integer %function %spec  LOOK
   34  !%external %integer %function %spec  GETWORD
   35  !%external %integer %function %spec  GETLONG
   36  %external %integer %function %spec  TAG %alias "GETLONG";  ! For pass 2
   37  %external %string(63) %function %spec  ITOS (%integer n, p)
   38  
   39  ! streams
   40  %const %integer  report      = 0
   41  %const %integer  object file = 1
   42  %const %integer  listing     = 2
   43  %const %integer  diag stream = listing
   44  
   45  ! miscellaneous
   46  %const %integer  max ident = 31;        ! Length for external linkage
   47  %const %integer  fatal = 16_1000002C;   ! Error exit code to VMS
   48  
   49  
   50  ! external data (defined in driver)
   51  %external %string(6) %spec  version;    ! Compiler version string
   52  %external %integer %spec  command
   53  %external %integer %spec  control
   54  
   55  ! command bit meanings (set by command line)
   56  %const %integer  diag bit  = 8_00004
   57  %const %integer  line bit  = 8_00010
   58  %const %integer  log bit   = 8_00020
   59  %const %integer  time bit  = 8_01000
   60  %const %integer  entry bit = 8_02000
   61  %const %integer  init bit  = 8_04000
   62  %const %integer  pic bit   = 8_10000
   63  
   64  ! control bit meanings  (%control n, or set by driver (/check= etc))
   65  ! bit set => check on
   66  
   67  %const %integer  ass check  =   1;      ! unassigned checking
   68  %const %integer  str check  =   2;      ! string capacity checking
   69  %const %integer  for check  =   4;      ! %for checking
   70  %const %integer  arr check  =   8;      ! array bound checking
   71  %const %integer  ovf check  =  16;      ! integer overflow checking
   72  %const %integer  rec round  = 128;      ! rounding in records (turns it on)
   73  %const %integer  profiling  = 256;      ! call TRACE (line no) at bounds
   74  
   75  ! object file commands  Pass2 => Pass3
   76  
   77  %const %integer  obj extern    = 1;     ! insert external entry
   78  %const %integer  obj code      = 2;     ! code block
   79  %const %integer  obj gla       = 3;     ! gla  block
   80  %const %integer  obj pdef      = 4;     ! external proc definition
   81  %const %integer  obj pspec     = 5;     ! external proc specification
   82  %const %integer  obj ddef      = 6;     ! external data definition
   83  %const %integer  obj dspec     = 7;     ! external data specification
   84  %const %integer  obj reloc     = 8;     ! relocate gla
   85  %const %integer  obj set       = 9;     ! set gla to tag address
   86  %const %integer  obj header    = 10;    ! start of procedure
   87  %const %integer  obj call      = 11;    ! procedure call
   88  %const %integer  obj jump      = 12;    ! jump
   89  %const %integer  obj prim spec = 13;    ! prim definition
   90  %const %integer  obj end       = 14;    ! end of object file
   91  %const %integer  obj line      = 15;    ! line number
   92  %const %integer  obj term      = 16;    ! end of block
   93  %const %integer  obj diag p    = 17;    ! diags for proc header
   94  %const %integer  obj diag v    = 18;    ! diags for variable
   95  %const %integer  obj weak      = 19
   96  %const %integer  obj b lab     = 20;    ! bxxb in m/code
   97  %const %integer  obj w lab     = 21;    ! bxxw in m/code
   98  %const %integer  obj glam      = 22;    ! initialise n items in GLA
   99  %const %integer  obj modd      = 23;    ! modify displacement
  100  %const %integer  obj prim ref  = 24;    ! call to prim
  101  %const %integer  obj ext ref   = 25;    ! call to external procedure
  102  %const %integer  last obj code = 25
  103  
  104  ! directive file commands  Pass2 => Pass3
  105  
  106  %const %integer  dir used      = 1;     ! external used
  107  %const %integer  dir ldef      = 2;     ! label definition
  108  %const %integer  dir pref      = 3;     ! procedure reference
  109  %const %integer  dir cref      = 4;     ! conditional label reference
  110  %const %integer  dir uref      = 5;     ! unconditional label reference
  111  %const %integer  dir end       = 6;     ! end of procedure
  112  %const %integer  dir sizes     = 7;     ! end of directives+sizes
  113  %const %integer  dir x end     = 8;     ! end of external entry
  114  %const %integer  dir header    = 9;     ! start of procedure
  115  %const %integer  dir entry     = 10;    ! define entry label
  116  %const %integer  last dir code = 10
  117  
  118  %end %of %file

   79 Statements compiled
