home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / pascal / pasdox / ramdisk.txt < prev    next >
Text File  |  1985-11-18  |  6KB  |  143 lines

  1. { -----------------------------------------------------------------------------
  2.  
  3.                                  NOTICE:
  4.  
  5.       THESE MATERIALS are UNSUPPORTED by OSS!  If you do not understand how to
  6.       use them do not contact OSS for help!  We will not teach you how to 
  7.       program in Pascal.  If you find an error in these materials, feel free
  8.       to SEND US A LETTER explaining the error, and how to fix it.
  9.  
  10.       THE BOTTOM LINE:
  11.  
  12.          Use it, enjoy it, but you are on your own when using these materials!
  13.  
  14.  
  15.                                DISCLAIMER:
  16.  
  17.       OSS makes no representations or warranties with respect to the contents
  18.       hereof and specifically disclaim all warranties of merchantability or
  19.       fitness for any particular purpose.   This document is subject to change
  20.       without notice.
  21.       
  22.       OSS provides these materials for use with Personal Pascal.  Use them in
  23.       any way you wish.
  24.  
  25.    -------------------------------------------------------------------------- }
  26.  
  27.  
  28.  
  29.  
  30.               Using Personal Pascal With a Ramdisk
  31.  
  32.  
  33. So  you  say you want to use a ramdisk with your  Personal  Pascal
  34. Compiler on a 520ST?   Well,  before you go rushing off to try it,
  35. here are a few pointers.
  36.  
  37. You  might think you could just set up a 360K  ramdisk,  copy  the
  38. whole  Personal Pascal disk onto it,  and be ready to  go.   After
  39. all, you have 512K of memory in your 520ST, don't you?  Naturally,
  40. it is not as simple as it sounds.
  41.  
  42. Personal Pascal requires about 160K of working or "free" memory to
  43. properly  compile most programs.   The GEM Desktop eats  up  about
  44. 100K  of  memory  for its own purposes.   So there  goes  260K  of
  45. precious memory right off the bat.  And to make matters worse, the
  46. PASCAL.PRG  shell uses about 35K of memory on top of it  all.
  47.  
  48. This means that you must leave about 300K of memory free when  you
  49. set up the ramdisk.    If you are using any desk accessories, this
  50. will  reduce  the  amount  of  memory  available  to  the  system.
  51. Assuming no desk accessories,  you should be able to set up a 200K
  52. ramdisk with no problem.   If you have desk accessories, you might
  53. want to try a 150K ramdisk.
  54.  
  55. Now that you have your ramdisk ready to go,  how can it be used to
  56. reduce wear and tear on your disk drives?   Well, you can put your
  57. source  code on the ramdisk.   This will help somewhat,  but  will
  58. require  accesses  to  the disk drive  to  load  the  editor,  the
  59. compiler, the linker, and the libraries.
  60.  
  61. We  recommend that you use a ramdisk of 150K to 200K and put  your
  62. source code along with the Pascal libraries on the ramdisk.   This
  63. will have the most dramatic effect during linking,  as the  linker
  64. is the most disk-bound program.
  65.  
  66. The  only problem is that the linker expects to find  the  library
  67. files PASLIB and PASGEM on the disk that you ran PASCAL.PRG  from.
  68. Since this will be either drive A or B,  just copying the  library
  69. files to the ramdisk will have no effect.   What we need to do  is
  70. tell Personal Pascal to use the library files on the ramdisk.
  71.  
  72. Before starting,  PLEASE PLEASE PLEASE make a backup copy of  your
  73. MASTER  Personal  Pascal Disk.    We don't want you  to  make  any
  74. changes  to  the original.   Use the backup copy when  you  follow
  75. these instructions!
  76.  
  77.   Now  we can present the patented nine step process for setting  up
  78. Personal Pascal to use the library files on the ramdisk.
  79.  
  80.      1.  Rename  PASLIB  and PASGEM to PASLIB.O and  PASGEM.O  on
  81.          your diskette.   This can be done in the GEM desktop  by
  82.          clicking once on PASLIB and choosing "SHOW INFO" in  the
  83.          FILES  menu of GEM.   You will see a dialog box  with  a
  84.          whole  bunch of information.   Press  the period key <.>
  85.          then  type  the  letter  O  (not  zero), then  press the
  86.          <RETURN> key.  Repeat the same process for PASGEM.
  87.  
  88.      2.  Enter Personal Pascal,  and edit a file called NULL.PAS.
  89.          Type in the following lines:
  90.  
  91.          {$M+}
  92.          PROGRAM NULL;
  93.  
  94.            BEGIN
  95.            END.
  96.  
  97.          and press the <F10> key.
  98.  
  99.      3.  Select the "Linker Options" in the "Options" menu and in
  100.          the "Additional Link Files" box type the line:
  101.  
  102.           D:PASGEM,D:PASLIB
  103.  
  104.          where  D:  is whatever drive code you have  assigned  to
  105.          your ramdisk.
  106.  
  107.          WARNING: If you are compiling programs for TOS, you must
  108.          not  use PASGEM in the additional link  files.   Linking
  109.          PASGEM   with  a  TOS  program  will   cause   countless
  110.          headaches.
  111.  
  112.      4.  Enter  select  the  "Compiler Options"  dialog  box  and
  113.          enter D: into the "Temporary Directory" line.
  114.  
  115.      5.  Having  done  this,  select  "Save  Options..."  in  the
  116.          "Options" menu to save these modifications.
  117.  
  118.      6.  Set your compiler options so that the compiler DOES  NOT
  119.          CHAIN to the linker, then compile NULL.PAS.  Assuming no
  120.          errors  during  compilation,   select  "Quit"  from  the
  121.          "Files" menu, and return to the GEM desktop.
  122.  
  123.      7.  Select (click on) the file called NULL.O.   Select  SHOW
  124.          INFO from the FILE menu,  press the <ESC> key,  and type
  125.          in the name PASLIB.  Hit <ENTER>.
  126.  
  127.      8.  Make a copy of this new PASLIB (by dragging PASLIB  onto
  128.          the  same  window).   When you see the  "NAME  CONFLICT"
  129.          dialog box,  press <ESC> and type in the name PASGEM and
  130.          press <RETURN>.
  131.  
  132.      9.  Go  out and celebrate!!   You have successfully  set  up
  133.          Personal Pascal to use your ramdisk.
  134.  
  135.  
  136. Now, when you want to use your ramdisk, you will have to copy your
  137. Pascal  source code,  along with the files PASLIB.O  and  PASGEM.O
  138. onto  the  ramdisk before compiling and  linking,  but  the  speed
  139. improvement should be well worth the effort.
  140.  
  141.  
  142.  
  143.