Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/25/tdiv.mem
There is 1 other file named tdiv.mem in the archive. Click here to see a list.











                               CHAPTER 1

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.1-1

741101    780302      6                           Ingrid Wennerstrom








IV      THE DEBUG SYSTEM
        ----------------


IV.1    SYSTEM DESCRIPTION

        The SIMULA Language Handbook Part  II,  Chapter  9,  contains  a
        description of the SIMDDT system from the user's point of view.

        The main tasks of SIMDDT are:
     *  to produce a message stating the reason for SIMDDT invocation.
     *  to produce a diagnostic message when a run time error  has  been
        found.   The  message  contains  a  reference to the source line
        where the error occurred.
     *  to respond to valid user commands and give a message for invalid
        commands.
     *  to set, remove or display breakpoints in the user program.
     *  to perform breakpoint actions on reaching a breakpoint.
     *  to display values of variables, the  entire  storage  pool,  the
        operating  chain and all scheduled processes (OUTPUT, VARIABLES,
        CHAIN, SCHEDULED and ALL commands).
     *  to change the value of a variable (INPUT command).
     *  to direct the output from SIMDDT to  another  file  or  terminal
        than the user TTY (USE command).
     *  to take command  input  from  a  file  or  another  terminal  (@
        command).
     *  to display source program lines (DISPLAY command).
     *  to change the viewpoint of the program (INSPECT).
     *  to close files on demand (CLOSE).

        The SIMDDT program is self-relocating and is read from  disk  by
        the  SIMRTS  routine OCLD on demand.  It exists as a binary file
        SIMDDn.ABS (n = version number, e.g. 4).  The file  is  normally
        read  into  the  dynamic part of the low segment area and may be
        moved by the garbage collector routine  (SAGC).   If  SIMDDT  is
        invoked  before the SIMULA program starts execution, however, by
        a LOAD-REENTER sequence or a DEBUG command, it  will  be  placed
        before  the SIMULA data area and will not be moved, neither will
        it disappear if the program exits and is restarted  by  a  START
        command.   The  SIMDDn.ABS file is generated by execution of the
        special utility program SUTABS loaded together with the REL file
        produced by assembling the SIMDDT source modules.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.1-2

741101    780302      6                           Ingrid Wennerstrom








        The commands to SIMDDT are normally taken from the user terminal
        but  may  be  taken from a file (or terminal) specified by the @
        command.  Communication with the RTS is via information  in  the
        low  segment STATIC area and via accumulators at entry to SIMDDT
        and to RTS routines from SIMDDT.

        Output from SIMDDT is written on the user's TTY (which may be  a
        controlling  PTY  if  SIMDDT is run in a subjob to e.g. BATCON).
        Output can also be directed to a disk file or another TTY.
        New feature starting with version 4(302):   If  another  TTY  is
        used both as input (@TTYn:) and as output (USE TTYn:), no output
        will appear on the controlling user TTY.  This is useful if  the
        ordinary TTY should be undisturbed by debug info.

        The LINE NUMBER TABLE generated  by  the  compiler  is  used  by
        SIMDDT  to  find  the  core address that corresponds to a source
        program line or vice versa.
        One type of entry found in the line number table shows the block
        structure of the program.  From these entries, the corresponding
        SYMBOL TABLES can be found (via the prototypes) and this enables
        SIMDDT  to  find  the  proper  match to an identifier given in a
        command by following the block structure outwards.  SIMDDT  only
        accepts  identifiers  visible  from  the  current block.  For an
        OUTPUT or INPUT command, the current block is the block in which
        program  execution was interrupted, and for a breakpoint command
        (AT ...) it is the block containing the statement referenced via
        the line number.
        The INSPECT command can be used to  change  the  current  block,
        however,  to  any block reachable via the operating chain or via
        reference variables.

        The SYMBOL TABLES generated by the  compiler  contain  for  each
        identifier  its  name, characteristics and the offset within its
        block instance.  Every object with a prototype also has a symbol
        table.

        The BREAKPOINT RECORD TABLE contains the  information  from  the
        user breakpoint commands and the instructions that were replaced
        by breakpoint UUO's  in  the  generated  code.   The  breakpoint
        record  contains  pointers  to the line number table, the symbol
        tables  and  the  effective  block  level   (copied   from   the
        prototype).   To  implement the IFCHANGED form of the breakpoint
        command the REF and TEXT variable addresses and values  must  be
        kept between breakpoints.  The SIMDDT work area does not contain
        space for the actual text values saved.  To solve the space  and
        relocation  problems  for these variables, one REF array and one
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.1-3

741101    780302      6                           Ingrid Wennerstrom








        TEXT array are allocated via the RTS.  Old REF and TEXT pointers
        are  kept  in  those arrays, which are properly relocated by the
        garbage collector, thus the referenced values will  be  retained
        for later comparison.

        The KEYWORD TABLE contains one entry for each special identifier
        or  operator  that  must be recognized by SIMDDT when scanning a
        user command.  The entry consists of name (SIXBIT), control bits
        and a dispatch routine address for command starting kewwords.

        All messages form SIMDDT are created in SIMDDT and this  applies
        also to most of the messages from the generated program and from
        SIMRTS.  Some  terminating  error  messages  and  the  I/O  file
        specification  dialogue messages are not handled by SIMDDT.  The
        method for handling diagnostic messages is almost  the  same  as
        the method used in the compiler, see II.5.











                               CHAPTER 2

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-1

741101    780302      6                           Ingrid Wennerstrom








IV.2    SIMDDT DECOMPOSITION


        SIMDDT consists of the following components:

        Source module   Function

        SIMDS1          entry points

        SIMDS2          I/O, messages,  initialization,  search  of  the
                        line   number  table  and  interface  to  SIMRTS
                        routines.

        SIMDS3          breakpoint   table   processing,   output   text
                        creation,  search  of symbol tables and scanning
                        of input.

        SIMDS8          error message table start address.

        SIMEDS          error message tables created by SUTEDS utility.

        SIMDS9          breakpoint and command processing.

        SIMDS7          data area.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-2

741101    780302      6                           Ingrid Wennerstrom








 IV.2.1  Main flow
         ---------
 
   -----------      -----------       -----------        -----------
  ( from OCEI )    ( from OCUU )     ( from OCRE )      ( from OCUU )
   -----------      -----------       -----------        -----------
        !                !                 !                  !
        !                !                 !                  !
 +-------------+  +-------------+   +--------------+   +--------------+
 ! DSINI       !  ! DSINB, DSBP !   ! DSINR        !   ! DSINE        !
 ! initialise  !  ! breakpoint  !   ! ^C-interrupt !   ! Error in the !
 ! SIMDDT      !  ! actions     !   ! - REENTER    !   ! program      !
 +-------------+  +-------------+   +--------------+   +--------------+
        !                !                 !                  !
        !             +-----+           +-----+            +-----+
        !     Y    +   break-  +      + SIMDDT  +       +  termin- +
        !<--------<    point    >   <   active    >-+  <   ating     >-+
        !          +   STOP?   +      + already?+   ! Y +  error?  +   ! Y
        !             +-----+           +-----+    (1)     +-----+    (1)
        !                ! N               ! N                ! N
        !               (2)                !                  !
        !                           +--------------+   +--------------+
        !                           !Output message!   ! Output error !
        !<--------------------------!with interrupt!   ! message      !
        !                           !address       !   !              !
        !                           +--------------+   +--------------+
        !                                                     !
        !<----------------------------------------------------+
        !
       (3)
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-3

741101    780302      6                           Ingrid Wennerstrom








                                      ----------       -----------
                  (3)               ( from START )   ( from OCSPDR )
                   !                  ----------       -----------
                   !                      !                 !
                   !                +------------+   +-------------+
                   !                ! DSINM      !   ! DSINS       !
                   !                !SIMDDT loa- !   ! Remove all  !
                   !                !ded with prg!   ! breakpoints !
                   !                +------------+   +-------------+
             +------------+               !                 !
             ! DSCM       !           ----------            !
 +---------->! accept user!         ( to .MAIN+2 )         (1)
 !           ! command    !           ----------
 !           +------------+
 !                 !
 !           +--------------------------------------------------+
 !           !                  !               !               !
 !     +------------+     +------------+  +------------+  +------------+
 !     ! DSAT       !     ! DSVA       !  ! DSPR       !  ! DSEX       !
 !     ! breakpoint ! ... ! VARIABLES  !  ! PROCEED    !  ! EXIT       !
 !     ! settings   !     ! command    !  ! command    !  ! command    !
 !     +------------+     +------------+  +------------+  +------------+
 !           !                  !               !               !
 +------------------------------+            +-----+            !
                                   Y      +   ENTER   +         !
                                +-------< via breakpoint>       !
                                !         +     ?     +         !
                                V            +-----+            !
                          +------------+        ! N          +-----+
                          ! Perform    !        !     N   +   DEBUG   +
                          ! breakpoint !        !<------<     mode      >
                          ! actions    !        !         +     ?     +
                          +------------+        !            +-----+
                                !         (1)-->!               !
                                !               !
                           -------------   -------------   ------------
                          (EXIT to progr) (RETURN to RTS) (EXIT to OCEP)
                           -------------   -------------   ------------
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-4

741101    780302      6                           Ingrid Wennerstrom








IV.2.2  Module contents
        ---------------

        The following list should  serve  as  an  index  to  the  source
        listing.  Detailed descriptions are given there.

        SIMDS1
        ------
        DSINI   Starts SIMDDT processing in debug mode.  Called from the
                RTS  routine  OCEI  before  starting  execution  of user
                program code.
        DSINE   Starting point in SIMDDT for error  processing.   Called
                from RTS (OCUU).  Outputs the error message.
        DSINEM Entry from INSPECT/START to repeat error message.
        DSINB   Start of breakpoint instruction processing.   Called  by
                OCUU.  Locates breakpoint and continues at DSBP.
        DSINR   Entry  point  after  ^C-REENTER  or  CONTINUE  following
                program exit.  Called from OCRE.  Indicates interruption
                point (source line) by a message.
        DSINRM Entry from INSPECT/START to repeat message.
        DSINC   This routine is entered from  a  code  sequence  in  the
                static  low  segment  area  on  return  from certain RTS
                routines which may have  caused  garbage  collection  or
                detected  an  error  (see  DSCRT).  Relocates the SIMDDT
                stack and I/O text variables if a garbage collection was
                performed  since  SIMDDT called the RTS routine.  Writes
                any error message replacing the message  prefix  ZYQ  by
                ZYD.
        DSINM   The  whole  program  starts  in  this  entry  point   if
                SIMDDT.REL was loaded with the user main program and the
                last entry point definition  seen  by  LINK  was  DSINM.
                This   feature  is  mainly  used  for  SIMDDT  debugging
                purposes.  Exits directly to the generated  program  (at
                .MAIN+2)  with the base address of SIMDDT (DSSTAR) in ac
                X1.
        DSINS   Removes all breakpoints.  Called from  the  RTS  routine
                OCSPDR  before  restarting  a  SIMULA  program  that has
                executed since being loaded  to  core.   Since  the  low
                segment  will be cleared, it is not possible to keep the
                breakpoints.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-5

741101    780302      6                           Ingrid Wennerstrom








        SIMDS2
        ------
        DSFK    Finds a keyword in the keyword table.
        DSTC    Converts a valid ASCII character to SIXBIT.
        DSIT    Inputs a command line from the TTY or a file.
        DSO     Several routines to  create  a  message  in  the  output
                buffer, write the buffer on the tty or a file.
        DSVO    Outputs message on file and tty.
        DSSCI   Loads next input character in an accumulator.
        DSSKB   Loads  next   non-blank,   non-tab   character   in   an
                accumulator.
        DSGI    Gets the next identifier or relational operator from the
                input buffer.
        DSIFK   Finds keyword identifier in input buffer.
        DSPM    Creates a message and puts it in the output buffer using
                the message tables generated by SUTEDS.
        DSIS    Initialises SIMDDT.
        DSISRB  Removes all breakpoints from user code.
        DSOC    Puts a character in the output text.
        DSONL   Initialises the output text pointers.
        DSINL   Initialises the input text pointers.
        DSPL    Locates an address in the line number table and puts the
                string    <MODULE>:<NNNNN>,    <MODULE>: O<oooooo>    or
                O<oooooo> in the output buffer.
        DSLL    Locates a line number in a given line number table.
        DSLO    Locates an octal address  in  any  of  the  line  number
                tables.
        DSEZLN  Searches the line number table for the main  program  to
                find  the  line  number  tables for external classes and
                procedures.
        DSPO    Puts an octal number in the output buffer.
        DSTX    Several routines handling the interface to the RTS  text
                routines TXPI, TXPR, TXGI and TXGR.
        DSCRT
        DSCTX   Save status and call an RTS routine via a code  sequence
                in  the low segment area.  Any call from SIMDDT to a RTS
                routine which may cause garbage collection  or  find  an
                error  must  be  routed via DSCRT or DSCTX.  DSCTX calls
                the TXGI or the TXGR routine.
        DSCLO   Collection of routines  that  close  a  (specific)  file
                using the RTS routine IOCL.
        DSBUTX  Initialises the input and output text pointers  and  the
                SIMDDT stack.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-6

741101    780302      6                           Ingrid Wennerstrom








        DSEXPR  Closes an open display file and resets variables.
        DSFSP   Creates a file specification.
        DSCF    Creates a file object and opens the file.
        DSCFAB  Allocate buffers when normal method cannot be  used  (no
                GC allowed).
        DSCFLB  Link buffers set up by DSCFAB.
        DSRUC   Finds static or dynamic link.
        DSRU    Calls DSRUC.
        DSLPR   Finds prototype  or  class  identifier  in  any  of  the
                existing line number tables.
        DSCHGC  Checks if a command is allowed (garbage  collection  may
                be prohibited).
        DSVAK   Checks for /-ARRAY, /-TEXT,  /-GC  or  /START:oooooo  in
                command.
        DSIOCT  Compute value of integer given in octal radix.

        SIMDS3
        ------
        DSRB    Releases all linked breakpoint entries (ZBE records).
        DSNB    Finds the next  breakpoint  entry  or  word  within  the
                breakpoint entry (ZBE).
        DSNBC   Finds the next breakpoint  entry  (ZBE)  which  contains
                information from a new command.
        DSFB    Reserve and link one  more  breakpoint  entry  (ZBE)  or
                reserve the next word within the breakpoint entry.
        DSPS    Puts identifier from the keyword  table  or  the  symbol
                table or puts MAIN or BLOCK in the output buffer.
        DSPI    Puts  <IDENTIFICATION2>  in  the  output  buffer.    The
                information is fetched from the breakpoint entries given
                in the call.
        DSNI    Gets a new <IDENTIFICATION>  or  <IDENTIFICATION2>  from
                the  input  buffer  and  places  the  information in the
                breakpoint entries (ZBE).
        DSSS    Finds all blocks  accessible  via  the  current  program
                block  or  via a specified class and its prefix classes.
                The symbol tables accessible for each block  are  passed
                as  parameters  (one  at  a  time) to a subroutine whose
                address is given in the call to  DSSS  as  a  parameter.
                DSSS searches the line number table and finds the symbol
                tables via the prototype pointers.
        DSCT    Checks if a symbol table entry (ZSD) can be  handled  by
                SIMDDT.
        DSLV    Locates the address of a variable with the help  of  the
                XCB ac and the breakpoint entries (ZBE).
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-7

741101    780302      6                           Ingrid Wennerstrom








        DSSPV   Gets system procedure value address.
        DSCSQU  Calls RTS routine CSQU to check a qualification.
        DSNILV  CAlls  DSNI  and  DSLV  to  find  the  address   of   an
                <IDENTIFICATION2>.
        DSPV    Edits the value of a variable into the output text.
        DSPVS   Outputs array elements or a complete block (*).
        DSFA    Puts the class, procedure or block identification in the
                output  buffer.   The  identification  consists of name,
                octal address, reactivation point or invocation address.
        DSVIV   Checks if a variable has its standard initial value.
        DSVAR   Fetches the subscript, dope vector and base address  for
                an array element.
        DSGS    Loads the next text constant character  from  the  input
                buffer.
        DSGL    Gets the statement identification <LINE> from the  input
                buffer  and returns the address of the correponding line
                number table entry.
        DSGV    Gets a <VALUE> from the  input  command  and  saves  the
                information in the breakpoint entry (ZBE).
        DSRLB   Resets all information from one breakpoint command.
        DSRLBA  Resets all information from one breakpoint command if an
                error occurred while scanning the command.
        DSRLBI  Removes a breakpoint instruction from the compiled code.
        DSRL    Removes the information  from  all  breakpoint  commands
                relating to the same breakpoint location.
        DSPB    Reconstructs a breakpoint command and  puts  it  in  the
                output buffer.
        DSLB    Scans the breakpoint records (ZBR) for  a  match  to  an
                input statement identification <LINE>.
        DSRAF   Reserves any free element in the REF array YDSREF.
        DSRAT   Reserves any free element in the TEXT array YDSTXT.
        DSFAR   Releases an element in the REF array YDSREF.
        DSFAT   Releases an element in the TEXT array YDSTXT.
        DSFCV   Loads address of a constant to an ac.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-8

741101    780302      6                           Ingrid Wennerstrom








        SIMDS9
        ------
        DSBP    Performs the actions specified for a breakpoint.
        DSCM    Outputs the prompting asterisk (*) on the terminal where
                commands  are input, scans the first word of the command
                and dispatches control to the  proper  routine  via  the
                keyword table.
        DSST    Sets a flag when STOP was found as the first word of the
                command.
        DSHE    Outputs helpful text on the terminal (HELP command).
        DSAT    Scans  the  AT  command,  saves  the  information  in  a
                breakpoint record and a set of linked breakpoint entries
                (ZBR and ZBE)  and  substitutes  a  special  instruction
                (BREAK UUO) for the user code instruction.
        DSDP    Outputs the  requested  source  program  lines  (DISPLAY
                command).
        DSOP    Handles the OUTPUT command.
        DSIP    Handles the INPUT command.
        DSRE    Handles the REMOVE command;  removes information for one
                or all breakpoints.
        DSBR    Handles BREAKS command, listing all breakpoint  commands
                currently  defined and removes a command if requested by
                the uesr.
        DSCL    Closes all open files except SYSIN, SYSOUT or lists  all
                open files, letting the user decide on closing each file
                separately.
        DSPR    Handles PROCEED command.  Exits from SIMDDT via the  RTS
                stack  if  SIMDDT was entered via DSINI, DSINE or DSINR.
                Interprets the user  instruction  and  branches  to  the
                following  instruction  if  SIMDDT  was entered at DSINB
                (breakpoint entry).
        DSUS    Handles USE command.  Calls the RTS routines IOLN, CPNE,
                CSEN  and  IOOP  to  establish  a USE file object and to
                initialise the file.
        DSCH    Handles CHAIN command.  Outputs operating chain starting
                from the current block.
        DSVA    Handles  VARIABLES  command.   The   garbage   collector
                routine in the RTS is called unless prohibited by a /-GC
                switch, by entering through DSINR or by the SWNOGC  flag
                being on.  All variables in the storage pool are listed,
                normally from the bottom of the pool, unless modified by
                a /START switch.
        DSPAE   Outputs an array identifier, its bounds  and  any  array
                element  which  have  values  different from the default
                initial value.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.2-9

741101    780302      6                           Ingrid Wennerstrom








        DSVA01  Outputs all variables in a block.
        DSSC    Handles SCHEDULED command.  Uses the SUNE  procedure  of
                the RTS to find the next scheduled process.
        DSPC    Handles INSPECT command.  Changes current block pointer.
        DSAL    Handles ALL command.  Invokes DSCH, DSVA, DSSC.
        DSEX    Handles EXIT command.  In error mode, exit  is  via  the
                SIMRTS  stack, in debug mode exit is to OCEP for program
                termination.
        DSNOPR  Handles NOPROCEED command.  Inhibits use of the  PROCEED
                command.  This allows more SIMDDT actions at the expense
                of not being able to continue.
        DSGET   Handles @ command.  Opens a file for  input  (using  the
                RTS  routines  for  file  handling) and sets the YDSITTY
                switch off to indicate command input from a file  (which
                may represent a disk file or another TTY).
        DSNOTI  Handles unimplemented commands.
        DSTERM
        DSIE    Entered  after  a  termination  error  detected   within
                SIMDDT.    Outputs  message  and  branches  to  OCEP  to
                terminate the program.











                               CHAPTER 3

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-1

741101    780302      6                           Ingrid Wennerstrom








IV.3    LOW SEGMENT ORGANISATION

        ACCUMULATORS  +---------------+   GENERATED PROGRAM
        ------------  !---------------!   -----------------
                      ! ZLN, ZSM, ZSD !   Constant records generated by the
                      ! ZPR, ZMP      !   compiler, referenced by SIMDDT,
                      : - - - - - - - :   see I.5
        XLOW -------> !---------------!
                      ! Global variab-!   STATIC LOW SEGMENT AREA
                      ! les (STATIC)  !   -----------------------
        XPDP -------> !...............!   Used by RTS and SIMDDT,
                      ! RTS stack     !   relocated by garbage collector
                      : - - - - - - - :
        XDBAS ------> :---------------:   DYNAMIC LOW SEGMENT AREA
                      :---------------:   ------------------------
                      ! ZDN           !   SIMDDn.ABS (approx. 6.5K)
        XDZBR ------> !---------------!
                      ! ZBR           !   SIMDDT data area:
                      !---------------!   Breakpoint record and
                      ! ZBE           !   entries
                      :---------------:
        XDSTK ------> :---------------:
                      ! SIMDDT stack  !
                      !---------------!
                      ! ZTE (ZDSZTE)  !   TEXT record for I/O
                      !---------------!
                      !input text buf !
                      !---------------!
                      !output text buf!
                      !---------------!
                      !input text str.!
                      !---------------!
                      ! ZAR (ZDSTXT)  !  TEXT array used by SIMDDT
                      !---------------!
                      ! ZAR (ZDSREF)  !  REF  array used by SIMDDT
                      :---------------:
                      :               :
        XCB --------> :---------------:
                      ! ZBI           !  Current block instance
                      :---------------:
                      :               :
                      +---------------+
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-2

741101    780302      6                           Ingrid Wennerstrom








IV.3.1  Static low segment area
        -----------------------

        This is the communication area for the RTS.  It is also used for
        interface  between  SIMDDT  and the RTS.  When SIMDDT is active,
        the XLOW ac always points to the STATIC area.

IV.3.2  SIMDDn.ABS
        ----------

        The SIMDDT code is read from the  disk  file  SIMDDn.ABS.   n  =
        SIMULA  system version number, e.g. the version 4 SIMDDT file is
        called SIMDD4.ABS.   Earlier  versions  were  called  SIMDDT.ABS
        regardless of version.  The data in the file has the form of two
        dynamic records,  one  ZYS  record  and  a  ZTE  (TEXT)  record,
        referenced as ZDSZTE.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-3

741101    780302      6                           Ingrid Wennerstrom








IV.3.2.1 Keyword Table (ZKW)
         -------------------
        
        +---------------------------------------+
        !ZKW!ZKW!ZKW!ZKWTYP!ZKWCOD!    ZKWADR   !
        !LNE!DBG!ERR!      !      !             !
        !---------------------------------------!
        !        ZKWNM1                         !
        !---------------------------------------!
        !        ZKWNM2                         !
        !---------------------------------------!
        !        !             !                !
        !---------------------------------------!
        !                                       !
        !- - - - - - - - - - - - - - - - - - - -!
        :                                       :
        :                                       :
        !---------------------------------------!
        !        !             !                !
        !---------------------------------------!
        !                                       !
        !---------------------------------------!
        :                                       :
        :- - - - - - - - - - - - - - - - - - - -:


        class ZKW; comment
        -----      -------
                        This class describes the format of  the  keyword
                        table.  Each keyword entry occupies two or three
                        words in the table.  Every  keyword  used  in  a
                        SIMDDT  command  has  an  entry  in  this table.
                        Entries   also   exist   for   the    comparison
                        (relational)  operators  >,  >=, ..., \=, == and
                        =/=.   All  entries  starting  with   the   same
                        character  form  a group.  Within this group the
                        entries are sorted on the length of the name;

        boolean ZKWLNE; comment
        -------         -------
        <0:0>           This flag is set when the second  word,  ZKWNM2,
                        of the name is present;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-4

741101    780302      6                           Ingrid Wennerstrom








        boolean ZKWDBG; comment
        -------         -------
        <1:1>           This flag is set when the keyword is allowed  in
                        a debug mode command;

        boolean ZKWERR; comment
        -------         -------
        <2:2>           This flag is set when the keyword is allowed  in
                        an error mode command;

        integer ZKWTYP; comment
        -------         -------
        <3:5>           This field gives the type of keyword.
                        The different types are:
                        start of command
                        inside command
                        used in relations
                        after / in INSPECT;

        integer ZKWCOD; comment
        -------         -------
        <6:17>          The accumulator XDBAS is placed in this field if
                        ZKWTYP is start of command.
                        This  field  gives  the  type  of  a  relational
                        operator or the type of a constant;

        integer ZKWADR; comment
        -------         -------
        <18:35>         This field  gives  the  relative  address  of  a
                        command  routine  if ZKWTYP is start of command.
                        For  a  relational   operator   it   gives   the
                        instruction  to  be  used  and  for  a  constant
                        (FALSE, NONE,  NOTEXT  or  TRUE)  it  gives  the
                        value;

        integer ZKWNM1; comment
        -------         -------
        <0:35>          This field gives the six initial  characters  of
                        the keyword (sixbit code);

        integer ZKWNM2; comment
        -------         -------
        <0:35>          This field gives the last six  characters  of  a
                        keyword  longer than 6 characters.  Only present
                        if ZKWLNE is set;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-5

741101    780302      6                           Ingrid Wennerstrom








IV.3.2.2 Error tables YE3DL, YE3D, YE3M and YE3MI

        These tables are described in section II.C.3.  The combined size
        is roughly 0.8 K words.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-6

741101    780302      6                           Ingrid Wennerstrom








IV.3.2.3 Breakpoint record ZBR
        
                  +-------------------------------------------------+
                  ! ZDN                                             !
                  !-------------------------------------------------!
             +----! ZBRZBE [0]            !          0              !
             !    +-------------------------------------------------+
             !    ! ZBRZBE [1]            !     ZBRZLN [1]          !
             !    +-------------------------------------------------+
             !    ! ZBRINS [1]                                      !
             !    +-------------------------------------------------+
             !    ! ZBRZBE [2]            !     ZBRZLN [2]          !----+
             !    !-------------------------------------------------!    !
             !    ! ZBRINS [2]                                      !    !
             !    +-------------------------------------------------+    !
             !    :                                                 :    !
             !    :                                                 :    !
             !    +-------------------------------------------------+    !
             ! +--! ZBRZBE [QBRN]         !     ZBRZLN [QBRN]       !    !
             ! !  +-------------------------------------------------+    !
             ! !  ! ZBRINS [QBRN]                                   !    !
             ! !  !-------------------------------------------------!    !
             ! +->! First ZBE for first breakpoint line             !--+ !
             !    !-------------------------------------------------!  ! !
             ! +--! Second ZBE for first breakpoint line            !<-+ !
             ! !  !-------------------------------------------------!    !
             ! +->! Last ZBE for first breakpoint line              !    !
             !    !-------------------------------------------------!    !
             !    ! First ZBE for second breakpoint line            !<---+
             !    +-------------------------------------------------+
             !    :                                                 :
             !    :                                                 :
             !    +-------------------------------------------------+
             +--->! First free ZBE                                  !--+
                  !-------------------------------------------------!  !
               +--:                                                 :<-+
               !  +-------------------------------------------------+
               +->! Last free ZBE                                   !
                  +-------------------------------------------------+
                  !                                                 !
                  !-------------------------------------------------!
                  !                                                 !
                  ! Work area for SIMDDT                            !
                  !                                                 !
                  +-------------------------------------------------+
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-7

741101    780302      6                           Ingrid Wennerstrom








        ZDN class ZBR;  comment
            -----       -------
                        This  class  describes   the   format   of   the
                        breakpoint  record.   It  is used for storage of
                        information from breakpoint commands.  The  last
                        part  of  the ZBR record is used as a work area.
                        Since the record is placed  inside  the  dynamic
                        record  for  the  first  part of SIMDDn.ABS, the
                        garbage collector  is  not  aware  of  it.   The
                        accumulator  XDZBR  addresses this record and it
                        would be possible to move  all  other  parts  of
                        SIMDDn.ABS  to the high segment keeping the data
                        area (ZBR record) in the low segment;

        ref (ZBE) array ZBRZBE[0:QBRN]; comment
        ---       -----                 -------
        <0:17>          The first entry in  this  array  points  to  the
                        first free breakpoint entry ZBE.  All free ZBE's
                        are then linked together.  The maximum number of
                        different    line   numbers   for   all   active
                        breakpoints is QBRN.  The ZBRZBE field points to
                        the first ZBE used for a set of breakpoints with
                        the  same  line  number.   The  line  number  is
                        specified  via the ZBRZLN field.  The pointer is
                        zero for unused entries.  The address ZBRZBE  is
                        relative to the start of the ZBR record;

        ref (ZLN) array ZBRZLN[0:QBRN]; comment
        ---       -----                 -------
        <18:35>         The array elements point to  line  number  table
                        entries  defining  the  corresponding breakpoint
                        line numbers.  An unused entry has a zero value;

        integer   array ZBRINS[0:QBRN]; comment
        -------   -----                 -------
        <0:35>          The array elements contain the instructions from
                        generated    code    replaced    by   breakpoint
                        instructions.  These entries are valid only when
                        the corresponding ZBRZBE element is non-zero;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-8

741101    780302      6                           Ingrid Wennerstrom








IV.3.2.4 Breakpoint entry ZBE
        
             AT line
             +----------------------------------------------------+
             !     ZBEZBE            !STO!STB!ZBETYP!             !
             !----------------------------------------------------!
             !                    ZBESTR                          !
             +----------------------------------------------------!
             !     ZBENIN            !         ZBENVA             !
             +----------------------------------------------------!
             !                    not used                        !
             +----------------------------------------------------!
        
             AT line list
             +----------------------------------------------------+
             !     ZBEZBE            !STO!STB!ZBETYP!             !
             !----------------------------------------------------!
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             !- - - - - - - - - - - - - - - - - - - - - - - - - - !
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             +----------------------------------------------------!
             !                         ZBEVSU                     !
             +----------------------------------------------------!
        
             AT line IFCHANGED list
             +----------------------------------------------------+
             !     ZBEZBE            !STO!STB!ZBETYP!             !
             !----------------------------------------------------!
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             +----------------------------------------------------!
             !                     ZBEVAL                         !
             +----------------------------------------------------!
             !                     ZBEVAL                         !
             +----------------------------------------------------+
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.3-9

741101    780302      6                           Ingrid Wennerstrom








             AT line IF relation
             +----------------------------------------------------+
             !     ZBEZBE            !STO!STB!ZBETYP!             !
             !----------------------------------------------------!
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             +----------------------------------------------------!
             !     ZBEROP            ! ZBETCI                     !
             +----------------------------------------------------!
             !                     ZBEVAL                         !
             +----------------------------------------------------!
        
             Continuation entry
             +----------------------------------------------------+
             !     ZBEZBE            !STO!STB!ZBETYP!             !
             !----------------------------------------------------!
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             +----------------------------------------------------!
             !    !IDL!IDD!EBL!SUN!  ! ZBEZSD                     !
             +----------------------------------------------------!
             !                     ZBEVAL                         !
             +----------------------------------------------------!


        class ZBE;      comment
        -----           -------
                        This  class  describes   the   format   of   the
                        breakpoint   entry   that   is   placed  in  the
                        breakpoint record.  The length is  QZBEL  (4  at
                        present)  words.   Each  new  breakpoint command
                        causes a number of ZBE records to  be  reserved.
                        These   contain   information   describing   the
                        breakpoint command and  the  breakpoint  action.
                        ZBE  entries are also used when processing INPUT
                        and OUTPUT commands but in this  case  they  are
                        released at exit from the command routine;

        ref(ZBE)ZBEZBE; comment
        ---             -------
        <0:17>          This field points to the next ZBE entry for  the
                        same  line,  or contains zero to mark the end of
                        the chain.  The address is relative to the start
                        of the breakpoint record;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                IV.3-10

741101    780302      6                           Ingrid Wennerstrom








        boolean ZBESTO; comment
        -------         -------
        <18:18>         This flag is set when STOP was specified in  the
                        command;

        boolean ZBESTB; comment
        -------         -------
        <19:19>         This flag is set when a text string was  present
                        in the command;

        integer ZBETYP; comment
        -------         -------
        <20:23>         This field gives the type of the ZBE  entry  and
                        it  can assume one of the following meanings and
                        codes:
                        AT                QBEAT
                        AT list           QBEATL
                        AT IFCHANGED list QBEATC
                        AT IF relation    QBEATR
                        continuation      QBECON
                        ;

        integer ZBESTR; comment
        -------         -------
        <0:35>          This field is only present if the ZBESTB flag is
                        set.   It contains the first 5 characters of the
                        string.   This  entry  may  exist  for  all  but
                        continuation type ZBE entries;

        integer ZBENIN; comment
        -------         -------
        <0:17>          This field is only present if type is QBEAT.  It
                        gives   the  initial  value  of  the  counter  n
                        (default = 1);

        integer ZBENVA; comment
        -------         -------
        <18:35>         This  field  gives  the  current  value  of  the
                        counter n.  The breakpoint action is carried out
                        when n is zero;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                IV.3-11

741101    780302      6                           Ingrid Wennerstrom








        ref(ZSD)ZBEZSD; comment
        ---             -------
        <18:35>         One word in ZBE is reserved for each  identifier
                        present  in the breakpoint commands.  This field
                        points to the  ZSD  entry  that  represents  the
                        identifier;

        boolean ZBEIDL; comment
        -------         -------
        <0:0>           This  flag  is   set   when   there   are   more
                        identifications left in a list;

        boolean ZBEIDD; comment
        -------         -------
        <2:2>           This flag is set when a dot was placed after the
                        identifier.   Note  that  subscripts may also be
                        present;

        integer ZBEEBL; comment
        -------         -------
        <3:9>           This integer gives the  effective  block  level,
                        copied  from the prototype record for the symbol
                        table containing the identifier;

        integer ZBESUN; comment
        -------         -------
        <10:13>         This integer gives the number of subscripts that
                        were placed after the identifier;

        integer ZBEVSU; comment
        -------         -------
        <0:35>          This integer gives the value of a subscript;

        integer ZBEVAL; comment
        -------         -------
        <0:35>          This field gives the value of a  constant  or  a
                        variable.  If the type is LONG REAL or TEXT, two
                        words are used.  The  value  of  a  variable  or
                        constant  is  saved  for  arithmetic, boolean or
                        character types.  For TEXT the value NOTEXT  may
                        be  saved,  also  the subscript to an element of
                        the ZDSTXT array.  For REF, NONE may  be  saved,
                        also   the  array  subscript  in  ZDSREF  and  a
                        prototype address for a variable  in  an  object
                        relation.   The ZBEVAL field is used in a QBEATC
                        type  entry  to  save  the  last  value  of  the
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                IV.3-12

741101    780302      6                           Ingrid Wennerstrom








                        variable  and  it  is  used in a QBEATR entry to
                        hold the value of  any  constant  given  in  the
                        command.   ZBEVAL  is  also  used  in  an  INPUT
                        command;

        ref(ZKW)ZBEROP; comment
        ---             -------
        <0:17>          This field  is  present  only  if  the  type  is
                        QBEATR.   It  points  to  the  relation operator
                        entry in the keyword table;

        boolean ZBETCI; comment
        -------         -------
        <18:18>         This flag is  set  if  a  constant  follows  the
                        relational  operator,  implying  that  the  next
                        field is ZBEVAL.   Otherwise  an  identification
                        follows;

        boolean ZBETHI; comment
        -------         -------
        <1:1>           This flag is set when THIS is used instead of an
                        identifier.   The  ZBEZSD  entry  points  at the
                        class prototype;

        boolean ZBEQUA; comment
        -------         -------
        <14:14>         This flag is set when  QUA  is  used  after  the
                        reference  variable.   The  class  prototype  is
                        placed  in  the  entry  following   the   normal
                        identification entries;

        boolean ZBESTA; comment
        -------         -------
        <15:15>         This flag is set when a * is used instead of  an
                        identifier;
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                IV.3-13

741101    780302      6                           Ingrid Wennerstrom








IV.3.2.5 SIMDDT stack

        This is a conventional stack used to hold return addresses  from
        subroutines  and as save area for accumulators for accummulators
        and other quantities.  It is addressed via the XDSTK  ac,  which
        is  set up for overflow detection by an interrupt.  Underflow is
        caught by a few addresses to  an  error  routine  at  the  stack
        bottom.


IV.3.2.6 SIMDDT work area

        This contains  the  internal  SIMDDT  variables  and  also  some
        instructions  used  by  the PROCEED command routine DSPR.  These
        instructions   are   relocated   by   SIMDDT   and   cannot   be
        write-protected.


IV.3.2.7 ZDSZTE, text record

        This record is used as a buffer area for  the  I/O  texts.   The
        first 3 elements in the YDSTXT text array contain text variables
        which point to three  subtexts  of  ZDSZTE,  each  QDSION  (135)
        characters   long.    The  buffers  have  the  subtext  form  to
        facilitate communication with the RTS text routines.


IV.3.3  ZAR records:  ZDSTXT and ZDSREF
        -------------------------------

        During initialisation, SIMDDT requests two arrays from  the  run
        time  system,  one  text  array and one ref array.  Any variable
        saved in those arrays is relocated by the garbage  collector  if
        the referenced data has been moved.











                               CHAPTER 4

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.4-1

741101    780302      6                           Ingrid Wennerstrom








IV.4    FILE DESCRIPTIONS


IV.4.1  SIMDDT input file
        -----------------

IV.4.1.1 TTY input

        The user TTY (which may be simulated by a PTY via a  controlling
        program)  is  normally used for all input to SIMDDT.  The INCHWL
        monitor call is used to  read  user  commands  into  the  ZDSZTE
        record.   The  YDSIPO  variable  contains  a byte pointer to the
        buffer and the first element in the ZDSTXT array  holds  a  text
        variable  which  points  to  the  proper  subtext  of the ZDSZTE
        record.


IV.4.1.2 Input file specified in @ command

        The command routine  DSGET  handles  the  @  command.   The  i/o
        routines  in  the RTS are used for all processing of files other
        than the user TTY.  The DSIT routine calls the IOIG  routine  to
        read  an input line.  The file is closed in the DSEX routine and
        if end of file is found.  From version 4(302), it is possible to
        direct  all  SIMDDT  i/o  to  another  terminal, including the *
        prompter, if the USE and @ commands specify a tty  device  other
        than the controlling TTY.


IV.4.2  SIMDDT output files
        -------------------

IV.4.2.1 TTY output

        The user TTY (simulated by a PTY when the job is  controlled  by
        another  job,  e.g.  in  batch)  is normally used for all SIMDDT
        output.  The output text is edited in the  ZDSZTE  text  record.
        The  variable YDSOPO contains a byte pointer into the buffer and
        the second element of the ZDSTXT array holds a  subtext  pointer
        to  the  buffer.   The  OUTSTR  monitor call is used to output a
        string to the TTY.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.4-2

741101    780302      6                           Ingrid Wennerstrom








IV.4.2.2 SYSOUT file

        The SYSOUT file is used for SIMDDT error mode output  if  SYSOUT
        is  not directed to the user TTY.  The DSINE routine outputs the
        last image created on the SYSOUT file before the error occurred.
        DSINE  also replaces the current image pointer for SYSOUT with a
        pointer to the output buffer in ZDSZTE.  Subsequently SYSOUT  is
        treated like a file specified in a USE command.


IV.4.2.3 Output file specified in a USE command

        The DSUS command routine handles the USE command.  The  RTS  i/o
        routines  are used for all processing of a file which is not the
        user TTY.  Only one USE file can exist.  Any existing  USE  file
        is  closed  when  a  new USE command is given.  The DSEX routine
        also closes the USE file.  The DSO set of routines call the IOOG
        (IOBO)  RTS  routine  to output a line from the ZDSZTE record to
        the file.  Some  output  to  the  USE  file  is  copied  to  the
        controlling  TTY,  unless  (from version 4(302)) the USE file is
        another terminal.


IV.4.3  DISPLAY file
        ------------

        The (source) file implied by the DISPLAY  command  is  read  and
        output.   The  RTS  I/O  routines are used.  The display file is
        closed on exit from SIMDDT.
        The name of the main source program is taken from a GETTAB entry
        and  the  name of an external source module is assumed to be the
        class or procedure name.  The extension is assumed to be .SIM.


IV.4.4  Help file
        ---------

        The help file HLP:SIMDDT.HLP is read and output.   The  RTS  i/o
        routines are used.











                               CHAPTER 5

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.5-1

741101    780302      6                           Ingrid Wennerstrom








IV.5    DIAGNOSTIC HANDLING


IV.5.1  Introduction
        ------------

        SIMDDT outputs  diagnostic  messages  for  all  errors  detected
        inside  SIMDDT  and  for most of the errors detected by the RTS.
        The possible error messages are listed in  the  SIMULA  Language
        Handbook  part  II,  appendix D.  A utility program, SUTEDS (see
        V.5), is used to create message tables  from  the  RUNOFF  input
        file for the handbook.  The SIMDDT routine DSPM reconstructs the
        message and puts it in the output text buffer.


IV.5.2  SIMDDT invoked from the RTS routine OCUU
        ----------------------------------------

        When the RTS detects an error, the error  number  and  the  user
        code address corresponding to the error are stored in the static
        low segment area and SIMDDT is started at its entry point DSINE.
        A  flag  is  stored with the error number determining if further
        processing is possible and which input is needed  if  any.   The
        diagnostic  handling  in  the RTS is described in III.5.  If the
        error was found in an RTS routine called  from  SIMDDT,  further
        processing is normally possible.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.5-2

741101    780302      6                           Ingrid Wennerstrom








        IV.5.3  Main flow of the DSINE routine
                ------------------------------
        
         ---------------------
        (Enter DSINE from OCUU)
         ---------------------
               !
            ------             ------       TTY/SYSOUT---+
          + SIMDDT +   Yes   + SIMDDT +  No ! ? ERROR    !    ------------
        <   active   >----><initialised >-->! WHILE INI- !-->(Exit to OCEP)
          +    ?   +         +    ?   +     ! TIATING .. !    ------------
            ------             ------       +------------+
            No !<------+          ! Yes
        +------------+ !       ------       TTY/SYSOUT---+
        ! Set SIMDDT ! !     +  RTS   + Yes !ZYDnnn      !    ------------
        ! error mode ! !   <called from >-->!message     !-->(Return via  )
        !            ! !     + SIMDDT?+     !ZYQ->ZYD    !   (SIMDDT stack)
        +------------+ !       ------       +------------+    ------------
               !       !          ! No
        +------------+ !       ------       TTY/SYSOUT---+
        ! Find       ! !     + SIMDDT + Yes !? ERROR     !    ------------
        ! <LINE> of  ! !   <  in error  >-->!WHILE PROCES!-->(Exit to OCEP)
        ! error      ! !     + mode ? +     !SING ERROR  !    ------------
        +------------+ !       ------       +------------+
               !       !          ! No
        TTY/SYSOUT---+ !   +------------+
        ! ? ERROR IN ! !   ! Indicate   !
        ! JOB AT     ! +---! replacement!
        ! <LINE>     !     ! ZYQ->ZYD   !
        +------------+     +------------+
               !
        TTY/SYSOUT---+
        ! ZYQnnn     !
        ! message    !
        !            !
        +------------+
               !
         ------------
        (Exit to DSCM)
         ------------
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.5-3

741101    780302      6                           Ingrid Wennerstrom








IV.5.4  SIMDDT internal errors
        ----------------------

        The SIMDDT routine DSOEM is called when  an  error  is  detected
        while scanning an input command or while processing a breakpoint
        action.  DSOEM outputs the input command up to the last  scanned
        character (if relevant) and the ZYDnnn message.  The rest of the
        command is  ignored  and  the  command  action  is  usually  not
        performed.   E.g.   the  command  "INPUT i:=1 xxx" will give the
        messages:
        INPUT i:= 1 x
        ZYD603 END OF INPUT EXPECTED
        The command "STOP AT 3,ab" gives:
        STOP AT 3,a
        ZYD605 INVALID LOOP COUNTER
        After the first command, the value of i is 1, but no  breakpoint
        is set at line 3 after the second command.

        The DSTERM  routine  is  called  when  an  unexpected  error  is
        detected  in  SIMDDT.   The ZYD675 message is output and program
        execution aborted via the RTS routine OCEP.


IV.5.5  Addition of a new message to SIMDDT or SIMRTS
        ---------------------------------------------

      - Insert the new message  in  the  RUNOFF  input  file  containing
        appendix   D  (SLH2C.RNO  or  SIMLH2.RNM).   The  assembly  time
        constants QZYQLN, QZYDFN, QZYDLN and QMSUPN must be  changed  if
        the  message  cannot  be  placed  in a free slot in the existing
        intervals.  The SUTEDS program must be accordingly modified.

      - Execute the SUTEDS program to  create  a  new  SIMEDS.MAC  file.
        Note   that  the  input  file  (see  above)  is  assumed  to  be
        DSK:SIMLH2.RNO.  The RUNOFF input file must thus be  temporarily
        renamed or copied to a file with the expected name.

      - Insert the code for the error message in the RTS or  the  SIMDDT
        routine  or  insert  code generation statements in pass 2 of the
        compiler if the error message will be detected by compiled code.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.5-4

741101    780302      6                           Ingrid Wennerstrom








      - Reassemble SIMDDT to create the SIMDDT.REL file.

      - Reassemble and link any changed RTS or compiled module.

      - EXECUTE SIMDDT.REL,SUTABS.MAC to create the SIMDDn.ABS file.











                               CHAPTER 6

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.6-1

741101    780302      6                           Ingrid Wennerstrom








IV.6    SIMDDT INTERFACE


IV.6.1  Monitor interface
        -----------------

        The monitor commands INCHWL and OUTSTR are used  to  communicate
        with  the  user  TTY.   All  other  i/o is performed via the i/o
        routines in the  RTS.   The  RTS  also  handles  traps  and  UUO
        processing.
        The job data locations .JBSA, .JBFF, .JBUUO and .JBOPS are  read
        by SIMDDT but not changed.


IV.6.2  Interface with generated code
        -----------------------------

        The address of the line number table for  the  main  program  is
        placed  in the static low segment area by the OCIN routine.  The
        ZLN table contains addresses to generated instructions which may
        be  replaced by a breakpoint instruction.  The ZSM, ZSD, ZPR and
        ZMP records are referenced by SIMDDT.

        If SIMDDT.REL was  linked  with  the  main  program,  the  start
        address .MAIN of the main program is used by SIMDDT, see DSINM.


IV.6.3  SIMRTS interface
        ----------------


IV.6.3.1 Entries to SIMDDT from SIMRTS

        The entry points DSINI, DSINB, DSINR, DSINE and DSINS of  SIMDDT
        are  used  by  SIMRTS,  see IV.2.1.  These entries are placed at
        fixed offsets from the  start  of  SIMDDT.   If  necessary,  the
        SIMDDn.ABS  file  will be read into the dynamic low segment area
        from disk.  SIMDDT.REL may also be linked with the main program,
        usually for SIMDDT debugging purposes.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.6-2

741101    780302      6                           Ingrid Wennerstrom








IV.6.3.2 SIMRTS routines used from SIMDDT
         --------------------------------

        SIMDDT  calls  a  SIMRTS  routine  according  to  the   standard
        interface for that routine.  No special code is placed in SIMRTS
        routines to check for a call from  SIMDDT.   If  a  routine  may
        cause garbage collection or find an error, the call is placed in
        the static low segment area YDSINC.  The return address must not
        point into SIMDDT since it may be moved by the garbage collector
        before the routine  returns.   The  eventual  return  to  SIMDDT
        enters at DSINC.  This routine relocates the return address kept
        in the SIMDDT stack.  The following RTS routines are called from
        SIMDDT:

        Name    Explanation
        ----    -----------

            -+
        IOLN !
        IOOP !
        IOOG !  I/O related routines called
        IOIG !  via DSCRTU and YDSINC(XLOW)
        IOOB !
        IOCL !
        CPNE !
        CSEN !
            -+

        CSQU    Qualification check called directly from DSCSQU.

        CSNA    Allocates array, called directly from DSIS.

        SUNE    Finds  next  event,  called  directly  from  DSSC.   The
                variable  YSUNE(XLOW)  contains the address of the YSUNE
                routine if Simulation is active.

        SAGC    Performs a garbage collection.  The  call  is  initiated
                from  the  DSVA  routine if the flag SWNOGC is off.  The
                SIMDDT routine DSCRTS and the YDSINC(XLOW) area are used
                to invoke SAGC.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.6-3

741101    780302      6                           Ingrid Wennerstrom








                                      --+
        TXVA    Text value assignment   !
        TXRE    Text relation           ! Called directly from
        TXST    Strip text              ! the SIMDDT routine
        TXPI    Put integer in text     !
        TXPR    Put real number in text !
                                      --+

                                      --+
        TXGI    Get integer from text   ! Called from
        TXGR    Get real from text      ! DSCTX
                                      --+

                                      --+
        TXBL    Create blank text       ! Called via DSCRTS
        TXCY    Create text copy        ! and YDSINC(XLOW)
                                      --+


IV.6.4  Global variables
        ----------------

        A part of the  static  low  segment  area  is  used  for  SIMDDT
        variables  that do not need relocation after garbage collection.
        The  variables  YSDBCOM,  YDSBSAV,  YDSINC,  YDSZLN   are   used
        internally  in  SIMDDT.   The  variables YDSEAD, YDSENR, YDSZLA,
        YDSNOG and YDSCAD are used by  SIMRTS  to  pass  information  to
        SIMDDT.   The RTS routines check the variable YDSWIT to find out
        if SIMDDT is active.  The size of SIMDDT is defined by QDSLG.

        YDSIGS is the start of a save area for the byte pointer  to  the
        break  character  found by INIMAGE (IOIG).  IOIG saves the value
        for SIMDDT use.

        The flag word YDSCLOSE is tested and set by the OCEP RTS routine
        and  by  SIMDDT.   It  is used to control file closing at end of
        execution.

        Another part of the static  low  segment  area  contains  global
        SIMDDT   variables   that  must  be  relocated  by  the  garbage
        collector.  The existence of pointers in this area also prevents
        the  corresponding  records  from being removed as garbage.  The
        variables in this area are:   YDSIAC,  YDSBAS,  YDSTXT,  YDSREF,
        YDSUFO, YDSSIOT, YDSCFO, YDSDFO, YDSSXCB, YDSRXCB and YDSIFO.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.6-4

741101    780302      6                           Ingrid Wennerstrom








        SIMDDT references the garbage collector variables YSABOT, YSATOP
        and YSAGCN.

        SIMDDT references the simulation variables YSULEV and YSUNE.

        SIMDDT also references the SYSOUT pointer YSYSOUT,  the  FORTRAN
        interface  variable  YFOXCB and the SIMRTS accumulator save area
        YUUOAC.











                               CHAPTER 7

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.7-1

741101    780302      6                           Ingrid Wennerstrom








IV.7    COMMON MACRO PARAMETER FILES

        The SIMDDT modules refer to the universal files  (.UNV)  SIMMAC,
        SIMMCR, SIMRPA.

        The $$RELO macro and the assembly variable $$BAS used in certain
        SIMMAC  macro definitions are redefined in SIMDS1.MAC.  Thus the
        instructions  generated  from  conditional  macros   and   field
        definitions  will not contain any relocatable addresses.  SIMDDT
        code is accessed via fixed offsets, indexed by XDBAS, which will
        always contain the base address of SIMDDT while executing within
        SIMDDT.

        The SIMRPA  macro  file  contains  definitions  for  the  SIMDDT
        variables  which are placed in the static low segment area.  The
        variable names all start with "YDS".











                               CHAPTER 8

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.8-1

741101    780302      6                           Ingrid Wennerstrom








IV.8    TESTING


IV.8.1  Compiler switches
        -----------------

        When compiling  a  SIMULA  program  used  to  test  SIMDDT,  the
        compiler switches D, I, L and Y should be set.


IV.8.2  Testing with DDT
        ----------------

        The DDT program has been heavily used to test SIMDDT.   Appendix
        H.9  of  the  SIMULA  Handbook  part II describes how to use DDT
        together with SIMDDT.

        To keep the SIMDDT symbol tables used by  DDT  in  core,  SIMDDT
        must  be  loaded  as  a  REL  file  with  the SIMULA program REL
        file(s).  The following command can be used:

        DEBUG/DDT usermainprogram.SIM,SIMDDT.REL[path]/REL

        The name of the loaded program will be SIMDDT - may  be  changed
        with a SAVE command specifying another name.

        It is often convenient to set a  DDT  breakpoint  in  DSCM,  the
        routine which reads a SIMDDT command.

        The line number table of the main program starts at the location
        .MAINL.

        The contents of some special ac's during SIMDDT execution are:

        Accumulator     Explanation
        -----------     -----------

        XPDP            SIMRTS stack pointer.
        XLOW            Pointer to static low segment  area  for  global
                        variables.
        XCB             Current block, never changed by SIMDDT.
        XDBAS           Base register for SIMDDT code.
        XDSTK           SIMDDT stack pointer.
        XDZBR           Pointer to SIMDDT data area.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.8-2

741101    780302      6                           Ingrid Wennerstrom








        XDINT           Pointer to input  text  variable.   Output  text
                        variable is at 2(XDINT).
        XDSWIT          SIMDDT status switches.
        XDZBE           Pointer to last referenced  ZBE  entry.   Useful
                        after a set breakpoint command.

        The global variable  YDSBCOM(XLOW)  holds  the  address  of  the
        instruction following the instruction replaced by a BREAK UUO.

        The local variable YDSCZBR has the  current  breakpoint  number.
        The address of the ZBR entry for the current breakpoint is found
        from  the  expression  3+(XDZBR)+(YDSCZBR),  where  ()   implies
        "contents".











                               CHAPTER 9

            SIMULA FOR DEC SYSTEM 10             TD, SIMDDT



SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.9-1

741101    780302      6                           Ingrid Wennerstrom








IV.9    SAMPLE PROGRAM

        The program DEMDDT.SIM listed in  appendix  H.9  of  the  SIMULA
        Language  Handbook part II can be used together with DDT to find
        out how SIMDDT works.

        The following figure shows the  contents  of  the  ZBR  and  ZBE
        records after the set breakpoint command:

        *AT 39 IFCHANGED refpc.lrpc

        See SIMDDT EXAMPLE, TRACING in the handbook.
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.9-2

741101    780302      6                           Ingrid Wennerstrom








        ZBR     :                                        :
                :                                        :
                !----------------------------------------!
                !          0        !         0          !
                !----------------------------------------!
                !                             0          !
                !----------------------------------------!
            +---!         63        !      4510          ! AT 39 IFCHANGED
            !   !----------------------------------------! refpc.lrpc
            !   !         MOVEI 1,         4532          ! Instruction saved
            !   !----------------------------------------!
            !+--!         57        !                    ! AT 28 IF ipc = 4
            !!  !----------------------------------------!
            !!  !                                        !
            !!  !----------------------------------------!
            !!+-!         53        !                    ! AT 8 fip1
            !!! !----------------------------------------!
            !!! !                                        !
            !!! !----------------------------------------!
        ZBE !!+>!          0        !                    !
            !!  !----------------------------------------!
            !!  !                                        !
            !!  !                                        !
            !!  !----------------------------------------!
            !+->!          0        !                    !
            !   !----------------------------------------!
            !   !                                        !
            !   !                                        !
            !   !----------------------------------------!
            +-->!         67        !  0  2  0  0  0  0  !
             +--!----------------------------------------!
             !  !  1  0  1  4  0  0 !      4563          !
             !  !----------------------------------------!
             !  !  0  0  0  2  0  0 !      4544          !
             !  !----------------------------------------!
             !  !                             0          ! Saved value of lrpc
             !  !========================================! (word 1)
             +->!          0        !         0          !
                !----------------------------------------!
        XDZBE-->!                             0          ! Saved value of lrpc
                !----------------------------------------! (word 2)
                !                not used                !
                !----------------------------------------!
                !                not used                !
                !----------------------------------------!
                :                                        :
SIMULA FOR DEC SYSTEM 10             TD, SIMDDT                 IV.9-3

741101    780302      6                           Ingrid Wennerstrom








                ZSD entry for refpc
                !----------------------------------------!
        4563    !  0  0  0  7  0  1 !         6          !
                !----------------------------------------!
                !  R  !  E  !  F    !  P  !  C  !        !
                !----------------------------------------!
                !                   !      4367          ! CLASS pc prototype
                !----------------------------------------!
                :   ZSD entry for lrpc                   :
                :                                        :
                !----------------------------------------!
        4544    !  0  0  0  3  0  1 !         5          !
                !----------------------------------------!
                :                                        :
                :                                        :
                :  ZLN entry for line 39                 :
                !----------------------------------------!
        4510    !         47        !      4246          !
                !----------------------------------------!
                :                                        :
        
                 Breakpoint instruction which replaces
                 the MOVEI 1,4532 instruction in code
                +----------------------------------------+
        4246    !  0  1  7  0  0  0 !        42          ! 42 is offset into
                +----------------------------------------+ the ZBR record
        
                Figure IV.9  Snapshot of core after set breakpoint instruction.