home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / demos / 57 / pascal / ramdisk.doc < prev    next >
Encoding:
Text File  |  1986-09-18  |  4.8 KB  |  113 lines

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