[comp.sys.dec.micro] Pro 350 programming notes

sjs@gnv.ifas.ufl.edu (03/26/91)

I was a PRO programmer for about 5 years, and I accumulated a lot of
programming notes, which I'll now send off into the ether...

I'd be glad to keep a compilation of PRO hints, tips, etc.  Just send it
via email.  My PRO isn't working right now (bad motherboard or hard disk
card).  If I ever get it fixed, I'd like to use it for BBSing/duplicating
and distributing PRO/350 software.  Anyone got parts they'd like to unload?




                   +------------------------------+
                   |  P R O / 3 5 0    N o t e s  |
                   +------------------------------+
                         As of March 25, 1991

         +++++++++++++++++++++++++++++++++++++++++++++++++++

         The  information   in  this   document   has   been
         accumulated through  trial  and  error,  and  other
         sources or  documents.  Where possible, the sources
         have been listed.

         Some  information   may  refer  specifically  to  a
         PRO/350 running P/OS 2.0 or 2.0A.  However, most of
         this information may be applied to other versions.

         +++++++++++++++++++++++++++++++++++++++++++++++++++




          +-------------------------------------------------------+
          |                         REFERENCES                    |----+
          +-------------------------------------------------------+    |
               +-------------------------------------------------------+
          
          
          Information from  the following  sources are  used in  various
          sections of this document.
          
          _________________________
          PRO Tool Kit - The Basics
          
          DECUS seminar notes by speaker Diane LoGuidice.
          
          _________
          DECUServe
          
          A dial-up  bulletin board/eletronic  conference  supported  by
          DECUS.

         
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



          
          +-------------------------------------------------------+
          |                       1.  LANGUAGES                   |----+
          +-------------------------------------------------------+    |
               +-------------------------------------------------------+
          
          
          ______________
          1.1 Fortran-77
          
          1)   Do not pass a constant to a subroutine if that subroutine
               alters the parameter variable:
          
               Main:          CALL A(7)
                              TYPE*,7
                              ...etc...
                              END
          
               Subroutine:    SUBROUTINE A(I)
                              I = 6
                              RETURN
                              END
          
          The TYPE*,7  in Main  will print a 6, not a 7, because the 7's
          address was  passed in  the subroutine  call, and subroutine A
          subsequently placed a new value (6) into that address.
          
          2)   To display a decimal number as unsigned, add it to 65536.
          
          Example:   If you  want to  print 61440 instead of -4096, then
          WRITE(6,10) 65536 - 4096.
          
          3)   ASSIGN will  "open" the logical unit number specified, so
               you cannot  do another  ASSIGN to the same LUN unless you
               CLOSE the LUN first.
          
          4)   DO loops  usually take longer than corresponding IF/THENs
               with counters because DO loops are usually sent to a run-
               time module  for evalutation  (or at least to a separate,
               generic module).
          
          5)   If you  want to send text to the screen and the record is
               longer than 133, do this:
          
               CLOSE(unit=6)
               OPEN(unit=6,file='TI:',recl=len,status='old')
          
          Set len  to whatever  line length  is necessary.  If you build
          your own output buffer, len could be 512, for example.
          
          6)   Fortran compiler speed improvement.
          
          To speed  up the  compiler, make  the  following  ZAP.    This
          increases the  symbol table  size.   After ZAPping,  exit  the
          Toolkit to  have it  take effect.    (From DECUServe, PRO note
          11.0, author Jerry Ethington.)
          
          ZAP command file:
          
               LB:[(toolkit directory)]PF7.TSK/AB
               1:352/
               000100V
               561
               X
          
          ZAP:
          
               $ RUN $ZAP
               ZAP> @(ZAP command file name)
          
          Compiler test:   64-block .FTN file compiled 4:58 before, 3:01
          after.
          
          7)   To  increase  file  I/O  handling  speed,  increment  the
               blocksize and buffercount qualifiers.
          
          Example: (also see section 2.5 note 4)
          
               INTEGER        bufsiz,bufct
               PARAMETER      bufsiz = 4096  ! 8 x 512 -> uses ACTFIL=8
               PARAMETER      bufct  = 2     ! x 2 -> need ACTFIL=16
          
               !  In this example, 8 x 512 x 2 = 8192 bytes are  !
               !  allocated for buffers.  The normal default is  !
               !  1 x 512 x 1 = 512 bytes for sequential files.  !
          
               OPEN(unit=1,name=filespec,blocksize=bufsiz,status='old',
             +   buffercount=bufct,readonly)
          
          The .CMD  ACTFIL qualifier  would be ACTFIL = 32 (or 34 if you
          also required  screen/keyboard WRITEs and READs) plus more for
          any other file handling.
          
          The blocksize  indicates the  physical I/O transfer size for a
          file.  The buffercount specifies the number of memory buffers.
          
          The default blocksize for sequential files is 512 bytes (hence
          ACTFIL need  only  be  incremented  by  1  per  required  file
          buffer).   It may  range from 1 * 512 to 127 * 512 bytes.  The
          above example  gives eight  times the  default size.  Refer to
          the  FORTRAN   user's  guide   for  defaults  for  other  file
          organizations.
          
          The default  buffercount for  sequential files  is one.    The
          value may  range from  -1 to  255.  -1 specifies that the file
          will be  opened in  block mode  rather than  record mode.  The
          size of each buffer is determined by the blocksize.

         ____________
         1.2 Macro-11
          
          1)   Give .PSECTs  their own  unique names  to prevent linking
               problems.
          
          The linker  stores the  segments with  identical names  in the
          same PSECT without regard to even/odd address placement.  This
          can result in randomly operating subroutines and bomb-outs.
          
          Data segments  can typically  be thrown together in a commonly
          named PSECT  by the  linker without  any problems; HOWEVER, be
          sure to  end each  PSECT with an .EVEN command so a word won't
          be thrown in after an odd byte.
          
          I don't  think .EVEN would work after program code .PSECTs, so
          I would always give these .PSECTs unique names.
          
          2)   QIO vertical format control codes (octal values):
          
               040       Output LF, then buffer, then CR.
               060       Output LF, LF, buffer, CR.
               061       Output FF, buffer, CR.
               053       Output buffer, CR.
               044       Output LF, buffer.
               000       Output buffer.
          
          3)   Determing odd/even numbers.
          
          A number  is odd  if the  least significant  bit (LSB)  is  1.
          Therefore, to  test for  even/odd (assuming  the number  is in
          R1):
          
               BIT  #1,R1     ; Note:  BITB also available.
               BNE  ODD       ; Handle odd number.
               ...            ; Handle even number.
          
          4)   Don't use R0 with MUL.
          
          I don't  know why, but if you use R0 with the MUL operator (as
          either the multiply-er or the multiply-ee), the multiplication
          will not be performed.  I've used R1, R2, and R3 successfully.
          
          5)   Converting integer to floating point.
          
          The following  code segment demonstrates the conversion of the
          integer value in R0 to a floating point (real) number in R2.
          
               SETF           ; Required before using conversion calls.
               SETI           ; List only once at code beginning.
               LDCIF     R0,R1     ; Causes # to be loaded/converted.
               STF       R1,R2     ; Causes # to be unloaded/stored.
               ...

         __________
         1.3 Pascal
          
          1)   If a  string does  not appear to be written to the screen
               properly, check  to see  if there are nulls in any of the
               cells.
          
          2)   Regarding checking  STATUS and  UFB for  a keyed, indexed
               file:
          
               o    Don't check  the STATUS  after the  OPEN,  check  it
                    after the  RESET or REWRITE.  The STATUS right after
                    an open may be EOF.
          
                    OPEN(_file...);
                    RESET(_file);
                    IF status(_file) = 1 THEN
                      open_flag := just_fine
                    ELSE
                      open_flag := trouble;
          
               o    Check the STATUS after a FINDK; if it is successful,
                    then do the READ.
          
                    FINDK(_file,...);
                    IF status(_file) = 1 THEN BEGIN
                      read(_file,_record);
                      operation_flag := just_fine;
                    END else BEGIN
                      operation := trouble;
                      { Flag this operation as bad unless it is }
                      { okay to find an empty key.              }
                    END;
          
               o    When doing  an UPDATE,  do the FINDK, check the UFB,
                    and if  it is  false, do  the UPDATE; if UFB is true
                    (that key  is empty),  do a  WRITE or  post an error
                    message.
          
                    FINDK(_file,...);
                    IF not UFB(_file) THEN BEGIN
                      _file^ := _record;
                      UPDATE(_file);
                      IF STATUS(_file) = 1 THEN
                      operation := just_fine
                    ELSE
                      operation := trouble;
                    END else BEGIN
                      operation := trouble;
                      { Unless it is okay to not find the record,     }
                      { in which case you can do a normal WRITE here, }
                      { but don't check the STATUS after doing that   }
                      { WRITE.                                        }
                    END;
          
          3)   Pass the  actual character  rather than  the ord() of the
               character in a parameter list.
          
          If you use:
          
               some_procedure (ord(ch_variable));
          
          and receive it with:
          
               procedure some_procedure (var num: [readonly]integer);
          
          then the variable num can end up with a scrambled value in the
          high byte  of its  word length,  because Pascal  doesn't clear
          variable storage with zeros.  Instead, use the call:
          
               some_procedure (ch_variable);
          
          and receive it with:
          
               procedure some_procedure (var ch: [readonly]char);
               var
                 num:    integer;
               begin
                 num := 0;              { Clear variable yourself. }
                 num := ord(ch);        { Now get numerical value. }
                 ...etc...
               end;
         
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




          +-------------------------------------------------------+
          |                  2.  PROGRAM DEVELOPMENT              |----+
          +-------------------------------------------------------+    |
               +-------------------------------------------------------+
          
          ______________________
          2.1 Program Optimizing
          
          Compiler optimizing  is usually  performed  by  the  compiler.
          However, if  you perform  some of  these steps  yourself,  you
          won't get  any "surprises" due to the compiler optimizing your
          code into  something you  didn't want  or expect.   You should
          always optimize  in heavily  used routines or loops.  (Notes 1
          through 6 from BYTE magazine article.)
          
          1)   Constant arithmetic
          
          Remove unncessary  math such  as a  *  1  or  b  -  0.    Fold
          expressions, such as a = 1.5 + 3.2 to a = 4.7.
          
          2)   Constant propagation
          
          Replace   variables assigned  a  constant  with  the  constant
          itself, such  as j  = 2;  k =  j +  5 with j = 2; k = 7.  And,
          replace x = a + b; c = a; y = c + b with x = a + b; y = a + b.
          
          3)   Common subexpression elimination
          
          Replace   a = b + c * d;    x = c * d / y   with    t = c * d;
          a = b + t; x = t / y.
          
          4)   Loop optimizations
          
          Move constant calculations out of a loop, such as:
          
               DO 10 I = 1,000
                 array(I) = x + y
          10   CONTINUE
          
          to:
          
               t = x + y
               DO 10 I = 1,1000
                 array(I) = t
          10   CONTINUE
          
          Also,  addition  and  subtraction  tend  to  be  quicker  than
          multiplication  and   division,  so   substitute  the   slower
          operation  in   frequented  loops.    Note  that  if  you  are
          frequently multiplying  or dividing  by a  power of 2, you may
          save computation  time if  you can  incorporate the  assembler
          opcodes ASL  and  ASR;  however,  making  repeated  calls  and
          passing parameters  to an  assembler subroutine  may be slower
          than using the higher language's offerings -- so see if can do
          the whole loop in assembler.
          
          Also note  that loops  may be  slowed down by the mechanics of
          the runtime  library for  that language.  If this is the case,
          IF/THEN statements  with GOTOs  may be faster than DO or WHILE
          loops.   If your  language is clunky in comparing strings, try
          breaking down  the comparison  to individual  characters (like
          what you  need to  do in  PASCAL to  compare  different-length
          arrays of  characters --  it's a  pain, but it's efficient and
          quick code).
          
          5)   Loop unrolling
          
          Unrolling loops reduces the number of increments and tests for
          loop control.  For example,
          
               DO 10 I = 1,100
                 a(I) = b(I)
          10   CONTINUE
          
          when unrolled by 2, becomes
          
               DO 10 I = 1,100,2
                 a(I) = b(I)
                 a(I+1) = b(I+1)
          10   CONTINUE
          
          and the loop itself is performed half as many times as before.
          
          6)   Loop jamming
          
          Combine separate loops into one loop.
          
               DO 10 I = 1,100
                 a(I) = 0
          10   CONTINUE
               DO 20 I = 1,100
                 b(I) = ' '
          20   CONTINUE
          
          should be combined to
          
               DO 10 I = 1,100
                 a(I) = 0
                 b(I) = ' '
          10   CONTINUE

          --------------------------------------------------------------
          
          7)   Put data  declarations for  characters after  integers to
               prevent odd/even address reference problems.
          
          8)   Use compile-time rather than run-time oriented data.
          
          Rather than declare constants as such:
          
               I     = 10
               J(1)  = 20
               J(2)  = 30
               label = 'JONES'
          
          which are performed during run-time, indicate the constants in
          the data section as such:
          
               DATA      I/10/
               DATA      J/20,30/
               DATA      label/'JONES'/
          
          The above  gets set  up when the program is compiled; when the
          program is  run, no  time is  wasted as  in the  previous case
          where each declaration is actively performed.
          
          9)   Use larger  records to  avoid  more  frequent  access  if
               possible.
          
          By grouping  several records  into one larger record, I/O to a
          file will occur quickly and with less overlead.  Also, in non-
          text files,  this type  of organization  will produce  smaller
          files because  RMS has  to attach  its  own  codes  onto  each
          record.
          
          __________________________
          2.2 Linker/Run-Time Errors
          
          1)   If a memory violation occurs during program start-up, you
               may need to overlay to recover some task space.
          
          Also see note (2) below.
          
          2)   If you  get a  "bad stack"  memory dump,  you may need to
               overlay to recover some task space.
          
          While a  program may  link under  the task  size  limits,  the
          program may  expand during  run-time to  accommodate file i/o.
          If there  is not  enough room  for this expansion, the program
          will bomb out with stack or addressing errors.
          
          3)   Undefined symbols segment.
          
          A variable  name is  not defined,  or it  was keyed  in wrong.
          Example:   YES(12) entered  in source  code as YSE(12) may not
          cause a  compiler error,  but it  may  be  responsible  for  a
          linkage error.  Check the source code.
          
          A call  is made  to a non-existant subroutine.  The subroutine
          name may  have been  keyed in  incorrectly, or not included in
          the overlay file (if separately compiled); it may be a part of
          a library which wasn't included in the cluster (CLSTR) line in
          the command  file; it  may be a call to a subroutine which was
          not linked to the task due to memory limits being breached.
          
          If the  undefined symbol  involves ORGIX$  and/or a subroutine
          name, check  to see that your subroutines are declared as such
          (they begin  with a  subroutine header  and end  with a return
          statement).   Also check to see that the subroutines listed in
          the .ODL  file are  being  called  by  anything  else  in  the
          program.   Remove or comment out any routines in the .ODL file
          that are not being used.
          
          Also check to see that you typed "LINK @cmdname" and not "LINK
          cmdname" (check for missing @).
          
          4)   Synchronous system trap (SST).
          
          This occurs  during run-time  if the  linker had problems with
          undefined symbol  segments.   The program  will blow up at the
          point at  which the unresolved code occurs.  You need to solve
          the link problem.
          
          5)   Run-time problem,  no error  message  displayed;  routine
               segment does not show signs of running properly.
          
          Check to see:

               o    If something was supposed to be INSTALLed before the
                    program is run.
          
               o    If you need to REMOVE an old version of the task and
                    INSTALL the new version.
          
               o    If you  need to remove any debugging goto's that now
                    point to non-existent routines.
          
               o    The task  may be  just small  enough  to  link,  but
                    during run-time  it expands  to a  size  beyond  its
                    addressing limits.
          
          6)   Non-contiguous disk space problem during link.
          
          You need  to remove  old, unused stuff from your disk (delete,
          purge, back  up) or  possibly re-format  your hard  disk.   Or
          maybe you should get a bigger hard disk.
          
          This warning  message indicates  that the  linker did not have
          enough room to lay the .TSK file down contiguously, which is a
          system-imposed requirement  for all task files.  The .TSK file
          was created, however, so after you scrape up some room, you do
          not have  to re-link,  just copy  the file  with a  contiguity
          qualifier.  The following will contiguously copy a task file:
          
                           COPY/CONTIG taskfile.TSK *.*
          
          To determine  the largest  contiguous space  on your disk, use
          the following command:
          
                                     DIR/FREE
          
          7)   Undefined global symbols.
          
          Something in  the .CMD  file didn't  pan out.  Maybe a library
          specified in  the CLSTR  line couldn't be found, or you didn't
          add a required GBLDEF.
          
          8)   Common block not loaded.
          
          This run-time  message appears  if a CLSTR line library is not
          installed prior to running or installing the task.
          
          For beginners,  this will  typically have something to do with
          the CGLFPU  library (CORE Graphics) or the language's run-time
          library.  To install a library, type:
          
                              INSTALL [ZZSYS]libnam
          
          where libnam is one of the following, depending upon what your
          task really uses.  Issue the INSTALL command one at a time for
          each required library.

                         LIBNAM    For
                         ------    ---------------
                         CGLFPU    CORE Graphics
                         PROF77    FORTRAN
                         PASRES    PASCAL
                         PBFSML    BASIC+2
                         CGLGRT    CORE Graphics playback command
          
          9)   Reserved instruction trap or alternating error messages.
          
          This run-time  problem may  indicate that while your program's
          segments might  have compiled  and linked correctly, as far as
          the system is concerned, it is accessing or trying to access a
          memory area  which it  is not  allowed to;  or, in an overlay,
          there may be large and small program segments being improperly
          swapped, or  a larger  segment may  be leaving  garbage behind
          when a  smaller segment  is swapped  in; or, data being placed
          into an  array (typically)  is overwriting  other data or code
          (check the array pointers or element counters).
          
          Try another  overlay format,  check the  sizes of  the overlay
          segments to  see if  they are  uneven (look at the object file
          sizes for  an approximate  idea), move  something out  of  the
          overlay group,  and try  again.   Also, your  program may be a
          trifle too  large, but large enough to cause an illegal memory
          size error during linkage.
          
          10)  Multiply defined symbols.
          
          This means  you have  more than  one subroutine or common with
          the same name (remember that all names/labels get truncated to
          six RAD50 characters by link-time).  Rename the duplicate.
          
          This can  also occur (though very rarely and typically only if
          you program  in MACRO)  if you  have a  subroutine, common, or
          variable name  that duplicates the name of something used by a
          library (such  as your  language's  run-time  library).    Try
          renaming your usage of the specified segment.
          
          Note:   The multiply  message is  a warning;  the linker  will
          still proceed.  The linker  will use  the first occurance of a
          multiply defined  routine or  name and  ignore the  duplicate.
          Therefore, you  may be  in for  some head-scratching surprises
          later when  you run  your task  and strange things occur.  You
          should always  resolve this  problem (unless you are a class-A
          PRO hack).
          
          11)  Syntax error in overlay file.
          
          Don't  stare   at  the   listed  line  too  long  --  it's not
          neccessarily the one you need to change.
          
          If the  ROOT line  is in  error, you  may be  trying to  do an
          impossible overlay.   Or,  is a  symbol name on the line shown
          not defined in a FCTR line?  Or, check each symbol name's FCTR
          line; the mistake may be there, or in a further FCTR line.
          
               Example:
          
                         ...etc...
               SUBS:     .FCTR subr1-subr2-*(A,B,C,D)
                         ...etc...
               B:        .FCTR subr4-@#$%
          
          There is an error (#@$%) on the B:'s FCTR line, but the linker
          will say  that the  error is on the SUBS:'s FCTR line, because
          that is where the B occurs first in the listing.
          
          12)  Illegal memory limits.
          
          Your task  exceeds the  allowable size limit.  Try a different
          (better) overlay  pattern.   If that  doesn't  work,  decrease
          array sizes, put things into files instead of memory, separate
          things into different tasks.
          
          Also try  recompiling the  code with the appropriate qualifier
          to indicate  that you  do not want the extra debugging/tracing
          code put  in; this will free a lot of task space.  (Note:  The
          debugging/tracing code  is put  in by  default.  You shouldn't
          remove this  stuff unless  you have  put  in  your  own  error
          detecting/catching routines or you know your routines are bug-
          free.)
          
          The tracing  code is  used, for  example, to  indicate that  a
          letter was  typed in  when a number was expected, and the line
          number  and   routine  name   may  be   displayed.     If  the
          debugging/tracing code  is removed,  a register  dump and task
          exit may  occur for  the same  minor  infractions  unless  you
          handle the error with other means.
          
          13)  Indirect file open failure.
          
          Check to  see that the necessary .CMD and .ODL files have been
          created for the linker.
         
          _____________
          2.3 Task Size
          
          1)   The total  task size may not exceed 32k words.  The upper
               8kw is  reserved for CLSTR libraries, so you have 24kw to
               play with.
          
          2)   A task  may use up to 8 APRs (active page registers).  An
               APR can handle up to 4kw, hence the task limit of 32kw.
          
          Certain things  like windowing  may use  up an  APR  just  for
          itself.
          
          3)   Task size  may be  determined  from  the  .MAP  file  (as
               generated via a specific LINK instruction).
          
          In the .CMD file, the typical line:
          
                             SY:name/CP/FP=SY:name/MP
          
          will have  the linker  make  a  .TSK  file  by  following  the
          instructions in  the .CMD  and .ODL  files.   IF you  add  the
          following, a .MAP file will be generated:
          
                          SY:name/CP/FP,name=SY:name/MP
          
          In the  .MAP file  is a  line "Task  image size:".  The number
          following indicates  how  many  words  the  task  uses.    For
          example, a  value of 24064. would indicate that 23.5kw is used
          (23.5kw =  24064/1024) and  that only  0.5kw of space is left;
          any additions may require overlay manipulation.
          
          4)   Task size may be determined from RMD.
          
          If the  task is  spawned (running  in the background), you can
          determine the  task size  by using  the SHOW  MEMORY  command.
          When the  main memory  display appears, press the A key.  Find
          the task name in the "Name" column and the corresponding value
          in the "Length" column.  The length value is in octal.
          
          For example, a length value of 136600 is 23.68kw.
          
                             136600 octal = 48512 dec
                             23.68kw = 48512/(1024*2)
         
          __________________
          2.4 Compiler Notes
          
          1)   When displaying  the portion of a line which is in error,
               the compiler  may show a portion which cannot be found by
               the editor through the use of its search/find function.
          
          After the  compiler lists an error, you may wish to search for
          the line the compiler is refering to.  In some rare cases, the
          editor will  not be  able to  find the code in question.  This
          can occur when the compiler shows the part of a line which has
          been entered  in the source code as a continued line.  The end
          of one  part of  a continued  line will  be shown  next to the
          beginning of the rest of the continued line.
          
          FORTRAN example  (where the  plus sign  is in the continuation
          field):
          
                              IF (X.gt.Y.and.B.lt.A.
                            +.and.D.ne.0) Z = 1
          
          This will generate a compiler error.  The segment shown by the
          compiler will  be "[LT.A..AND.]".   If you tried to search for
          that segment, the editor would not be able to find it.

          _________________
          2.5 Miscellaneous
          
          1)   Aliasing  subroutine  names  --  how  to  call  the  same
               subroutine using different names.
          
          Should you  wish CALL  HELP and  CALL DEFS  to access the same
          subroutine, for example, do the following:
          
               o    Decide which name to call the subroutine.  Let's say
                    HELP.
          
               o    Get a  memory allocation  map provided by the linker
                    and note the address of HELP.
          
               o    Add your calls to DEFS.  Compile.
          
               o    Link again after placing into the command file:
          
                    GBLDEF = DEFS:(address of HELP)
          
          A call  to HELP  and a  call to  DEFS will now access the same
          subroutine.
          
          2)   Adding comments to .ODL files.
          
          You can  add extra  comments to  .ODL files  (like after  file
          names) if  you preceed  the comment with a null (which appears
          in EDT  as ^@).  To make a null in EDT, press PF1, 0 (the zero
          key on the main keyboard, not the keypad), PF1 (again), then 3
          (on the keypad).
          
          I have  found this  very helpful  in allowing me to list brief
          descriptions of subroutines.
          
          For example:
          
                         ...etc...
               item1:    .FCTR clrscr        ^@-Clears graphics screen.
               item2:    .FCTR getkey-keyerr ^@-Handles keypress/errors.
                         ...etc...
          
          The linker will stop parsing the line at the null.
          
          3)   "AT LINE  nnn of INSTALL FILE" error message when running
               a menu-installed application.
          
          There is  a bug  in the  routine that  counts the lines in the
          .INS file; once a comment line is introduced, P/OS loses track
          of the  number of  lines.   Edit  out  the  comment  lines  to
          determine the real line number in question.

          A "-4  -20" error  usually means  that the appropriate library
          has not  been installed  prior to a program being run (similar
          to the Toolkit's COMMON BLOCK NOT LOADED error message).
          
          4)   FCS notes.
          
          These notes  are from  Barton Bruce by way of Bob Tinkelman on
          DECUServe RSX note 42.  (Also see section 1.1 note 7.)
          
               o    A task  normally uses  one 512  byte buffer for each
                    file it has open.
          
               o    ACTFIL is  not really  the number  of files you have
                    open, but  the number  of 512  byte (plus  overhead)
                    buffers you need.
          
               o    'READONLY', aside  from obvious usage, also sets the
                    bit  that  requests  anticipatory  read-aheads  into
                    extra buffers  rather than  the default write-behind
                    action.
          
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




          +-------------------------------------------------------+
          |                    3.  SOFTWARE NOTES                 |----+
          +-------------------------------------------------------+    |
               +-------------------------------------------------------+
          
          ___________
          3.1 Toolkit
          
          1)   How to find out the MCR equivalents of toolkit commands.
          
          MCR commands are useful in allowing you to spawn toolkit tasks
          with the  proper command  lines.  For example, you may wish to
          spawn PIP  to purge all files in the current directory at some
          point in your task.  In the toolkit, you would have typed:
          
                                      PU *.*
          
          In a command to PIP, however, you cannot use the above syntax.
          (The same  holds true if you run PIP directly via RUN $PIP and
          enter commands  to its  PIP> prompt.)   The  actual syntax the
          toolkit passes to PIP for the above instruction is:
          
                                    PIP *.*/PU
          
          To determine  this  and  other  toolkit  commands,  issue  the
          following to the toolkit $ prompt:
          
                                    SET DEBUG
          
          Subsequently, any  toolkit commands  you  enter  will  NOT  be
          executed --  but their  syntax elements (as passed to the task
          in question) will be displayed.
          
          To end the debugging session, enter to the toolkit $ prompt:
          
                                   SET NODEBUG
          
          The toolkit  will respond  with "SET -- BST FAILED" and resume
          its normal function.
          
          Example (user entries are in lower case):
          
               $ set debug
          
               $ pu *.*
               PIP *.*/PU
               $ set nodebug
               SET  --  BST FAILED
               $
          
          2)   How  to   determine  the  octal  values  of  certain  QIO
               functions.
          
               o    Extract the  QIOSYM module  from the  SYSLIB library
                    into a new file, QIOSYM.OBJ:
          
                    $ library/extract
                    Library? DW1:[1,5]SYSLIB.OLB
                    Module? QIOSYM
                    To? QIOSYM.OBJ
          
               o    Via the  Task Builder,  create a MAP file which will
                    contain the I/O function code values:
          
                    $ run $PAB
                    PAB>,QIOSYM=QIOSYM
                    PAB>//
          
               o    At the  next $  prompt, you  will be  able to  type,
                    edit, or  print the  text file  QIOSYM.MAP.  It will
                    list (among  other things)  the octal  values of all
                    I/O function codes.
          
          3)   How to reclaim disk space occupied by "invisible" files.
          
          Sometimes, as  when you  abort a  compile or  link,  temporary
          files that  were created  will not be erased.  These temporary
          files do  not have  a directory  entry -- and hence, they will
          not appear  in a  directory listing.  The process that created
          this type of file did so by manipulating the master index file
          directly.
          
          Ordinarily, you  will not be able to tell that these invisible
          files exist.   There  is one  Toolkit utility,  however,  that
          makes these  files visible:   VFY (file structure verification
          utility).
          
          You may  use the  following VFY procedure on any PRO hard disk
          or diskette.   VFY  will  search  the  volume  and  place  any
          invisible file  entries into  the [1,3] directory.  Hence, you
          should create  a directory  [1,3] first  or VFY (while showing
          you what  invisible files  it  found)  will  leave  the  files
          invisible.
          
          Once the  files are  placed into [1,3], you may delete them to
          recover volume space.  These files are typically scratch files
          and deleting them will cause no problems.
          
          Enter the  following to  initiate  the  search  for  invisible
          ("lost") files:
          
               $ RUN $VFY
               VFY>/LO
          
          VFY will  then look for the lost files.  If any are found, VFY
          will list  them on  the screen.   When  VFY is  done, it  will
          return the VFY> prompt.  To quit from VFY, do a CTRL-Z:
          
               VFY>^Z
               $ +
          
          The found  files, as placed into [1,3], may have strange names
          and any block size (even zero).
          
          4)   Setting the printer port baud rate from DCL.
          
               $ SET TERM TT2: /SPEED:(nnnn,nnnn)
          
          where nnnn,nnnn  represents transmit  and receive  baud rates.
          To determine the current baud rate, do:
          
               $ SHOW SPEED/TT2:
          
          5)   Entering DCL  commands that  are more  than one  line  in
               length.
          
          Use a  hyphen (-)  before the line's carriage return.  In DCL,
          the command  is not  executed until  a line ending in <CR> not
          preceeded by a hyphen is encountered.  No DCL line can be more
          than 250 characters.
          
          6)   Setting protection on a file.
          
               $ SET PROT <filespec> [/qualifier(s)] <code>
          
          /Qualifiers:
          
               /DATE=dd-mmm-yy
               /SINCE=dd-mmm-yy
               /THROUGH=dd-mmm-yy
               /TODAY
               /EXCLUDE=filespec  (don't forget a version specification)
          
          <Code> is in the following format:
          
               (SYSTEM:RWED,OWNER:RWED,GROUP:RWED,WORLD:RWED)
          
          where SYSTEM, OWNER, GROUP and WORLD are user types (since the
          PRO is  usually used  as a  single-user system  the GROUP  and
          WORLD types are seldom relevant) and RWED represent four kinds
          of access to files:
          
               R    file can be read/run, copied, printed
               W    file can be written to
               E    user can change amount of disk space alloted to file
               D    file can be deleted
          
          Example:
          
          $ SET PROT TEST.*;*/SINCE=01-JAN-88/EXCL=*.OBJ;* (S:RWE,O:WRE)
          
          7)   How to  reassign a  device's LUN  after the task has been
               built.
          
               o    Install the task:   $ INSTALL <task>
          
               o    Assign the new LUN to the task:
                    $ ASSIGN/TASK=<install_name> <device:> LUN
          
               o    Run the task:  $ RUN <install_name>
          
          Example:   If  you  want  your  task  DATABASE  (install  name
          DATABA), which  currently uses  LUN 3  to write  to a file, to
          write the data to the printer, you would perform the following
          steps --
          
               $ INSTALL DATABASE
               $ ASSIGN/TASK=DATABA TT2: 3
               $ RUN DATABA
          
          TT2: is the device name for the printer.
          
          8)   Running RMD  (SHOW MEMORY) from a second terminal.  Note:
               This requires a BCC08 PR1/CONSOLE cable.
          
               $ INSTALL/NOREMOVE APPL$DIR:RMD.TSK/TASK=RMDT2
               $ ASSIGN/TASK=RMDT2 TT2: 1
               $ ASSIGN/TASK=RMDT2 TT2: 2
               $ SET TERMINAL:TT2:/VT125
               $ SPAWN RUN RMDT2
               $
          
          The above  reassigns RMD's  LUNs to  point to the TT2: device.
          RMD requires  a VT100-type  terminal setting  to run;  you may
          substitute the  /VT125 qualifier  with  one  that  more  aptly
          describes your terminal.
          
          Note:  You may still use SHOW MEMORY on the main terminal.
         
          _____________
          3.2 PRO/BASIC
          
          1)   How to run PRO/BASIC from the Toolkit.
          
          Find  the  directory  where  the  PRO/BASIC  install  file  is
          located.  To do this, in DCL type:  $ DIR [*]BASTSK.TSK
          
          Next, you  need to  copy the PRO/BASIC error message file from
          the  PRO/BASIC   directory  to   the   Toolkit's   application
          directory.   To do  this type  (substituting "PRO/BASIC direc-
          tory" with  the actual  directory name determined from the DIR
          above:  $ COPY [PRO/BASIC directory]:PROBASIC.ERR APPL$DIR:*.*
          
          Then, install the following files:
          
               $ INSTALL [ZZSYS]CGLFPU
               $ INSTALL [PRO/BASIC directory]BASCLU
               $ INSTALL [PRO/BASIC directory]BASTSK
          
          To run PRO/BASIC, do:  $ RUN PROBAS
          
          You may  wish to  put the  install commands  into a .CMD file.
          Note that if any of the above files are already installed, the
          Toolkit will issue the warning (which you may ignore) "INSTALL
          -- Task name in use."
          
          ________________________________
          3.3 P/OS 2.0 Patch for 20 MEG HD
          
          Perform the  following ZAP  to alter  the POS.SYS  file on the
          PROSYSTEMS2 volume  diskette.   This ZAP works for version 2.0
          (not 2.0A)  of P/OS.   It  causes the system to recognize a 20
          meg hard disk (the Seagate ST225 is the one you want).
          
          Remove any write-protect tab from the PROSYSTEMS2 diskette and
          place it  in drive 1.  You should copy the file named below to
          another diskette  in case  you make  a mistake and want to try
          again.   (A separate  copy is suggested because ZAP alters the
          file directly -- it does not create a new version).
          
          Type the  following in the Toolkit (user entries are in bold).
          The ^Z is a control-Z.
          
               $ SET DEF DZ1:[ZZSYS]
               $ RUN $ZAP
               ZAP> POS.SYS/AB
               _162:770/
               _000004
               _162:776/
               _001146
               _163:004/
               _114577
               _162:756/
               _000240
               _^Z
          
               $ +
          
          The diskette  is now  ready to be used.  Place the 20-meg disk
          into the PRO and format/load P/OS using the altered diskette.
          
          Note:   P/OS may give a complaint regarding the hard disk when
          you boot up to format the hard disk, but it should say it will
          try to  rectify the  problem and  continue.   After the system
          continues, you should not see any error messages again.
          
          ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




          +-------------------------------------------------------+
          |                    4.  ABBREVIATIONS                  |----+
          +-------------------------------------------------------+    |
               +-------------------------------------------------------+
          
          
               ACP            Ancillary control process (FILES-11);
                              assigns logical and equivalence names
                              (logical name table)
          
               ADB            Application diskette builder
          
               CAINS          Application installation services
                              utility
          
               CALCON         Call Services utility
          
               CAREM          Application removal services utility
                              (presents group menu)
          
               CBOOT          Runs the FIRSTAPPL.DIR; if one is not
                              specified, it runs CMAIN; also handles
                              any LOGIN application
          
               CCOPY          Diskette copying services utility
          
               CDUTL          Disk services utility
          
               CET            Callable editor; the PROSE editor, availa-
                              ble for calling from within a program
          
               CFILEX         PRO to PRO file transfer utility
          
               CFUTL          File services utility
          
               CGL            CORE Graphics library; see CGLFPU
          
               CGLFPU         CORE Graphics library; a set of general
                              purpose graphics subroutines designed for
                              a high-level language interface and com-
                              patible with the SIGGRAPH CORE Graphics
                              Standard
          
               CMAIN          Takes your application choice from a P/OS
                              menu and passes it to CTEX
          
               CMP            File Compare utility; compares two ASCII
                              files
          
               CNV            File Conversion utility; reads records
                              from one file of any type and stores them
                              in another file of any type
          
               COMLIB         PRO/Communications library
          
               CPHONE         Phone book menu services
          
               CPRNT          Callable Print services; a callable rou-
                              tine that allows programs to print a file,
                              stop continue or abandon a print job, or
                              obtain printer status; the CPUTL task
                              makes use of this routine
          
               CPUTL          Print services utility
          
               CRF            Cross-Reference processor; produces cross-
                              reference listings for MACRO-11 and task
                              builder files
          
               CSUTL          Set-up services utility
          
               CTEX           Calls the PARSER routine, executes the
                              .INS file of the application passed by
                              CMAIN, and runs the application; when the
                              application completes, CTEX starts CMAIN.
          
               CVUTL          View services utility
          
               DES            File Design utility; allows user to design
                              and create files
          
               DMP            File dump utility; allows user to examine
                              the contents of a file or a volume of
                              files
          
               DSP            File Display utility; displays description
                              of selected files
          
               DTE            PRO/Communications terminal emulator envi-
                              ronment
          
               EDT            EDT editor, DEC's standard text editor
          
               FCS            File control services
          
               FDT            Frame development tool; allows user to
                              develop menus consistent with other menus
                              on the PRO
          
               FDV            Form driver

               FLB            Forms library file extension
          
               FMS            Forms management system; includes an in-
                              teractive forms editor for designing
                              forms, a utility to convert and store
                              forms in libraries, and a driver for dis-
                              playing the forms
          
               GIDIS          General Image Display and Instruction Set;
                              a set of instructions that provide the
                              lowest-level, virtual device interface to
                              the PRO's graphics hardware
          
               IFL            Indexed File Load utility; reads records
                              from one file of any type and effeciently
                              stores them in an indexed file; also used
                              to reestablish areas of contiguity within
                              indexed files
          
               INDRCT         Indirect command processor; processes list
                              of DCL-specific commands as well as spec
                              ial directive which allow the user to con-
                              trol command file processing
          
               LBR            Librarian utility; allows users to create,
                              update, modify, list, and maintain library
                              files
          
               MCR            Monitor console routine
          
               NSHOD          Remote node services utility
          
               ODT            On-line debugging tool
          
               OTS            Object-time system
          
               PAB            Professional application builder (a.k.a
                              TKB, a.k.a. LINKER); see TKB
          
               PARSER         Parses/resolves the .INS file as specified
                              by CTEX
          
               PIP            Peripheral Interchange Program; trans-
                              fers files from one standard Files-11
                              device to another;  used for Toolkit's
                              COPY, DIR, PURGE, DEL, etc.
          
               POS            Professional operating system (P/OS)
          
               POSRES         P/OS user interface services library
          
               PROFED         FMS-11 Forms editor

               PROFUT         FMS-11 Forms utility
          
               PROSORT        General-purpose sorting utility available
                              under P/OS
          
               POSSUM         P/OS system services library
          
               RMD            Resource monitoring display (SHOW MEMORY);
                              displays information about system re-
                              sources (volumes, tasks, memory)
          
               RMS            Record management services
          
               RMSDES         File design utility
          
               RMSRES         PRO/RMS-11
          
               SLP            Source Language Input Program; used to
                              maintain source files
          
               SYS            System file extension
          
               TKB            Task Builder (a.k.a PAB, a.k.a. LINKER);
                              converts relocatable object modules into
                              a single executable task image
          
               TMS            Telephone Management System
          
               UIC            User identification code, associated with
                              a user when the user's account is
                              established
          
               VFY            File Structure Verification utility;
                              checks for readibility and validity of a
                              file-structured volume
          
               ZAP            Task/File Patch Program; allows user to
                              directly examine and modidy task image and
                              data files on a Files-11 volume

* END OF FILE *