home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol028 / library.doc < prev    next >
Encoding:
Text File  |  1985-02-10  |  3.8 KB  |  117 lines

  1.           LIBRARY MAINTENANCE
  2.  
  3. by Ray Penley
  4.  
  5.  
  6.      Wσá havσ founΣ tha⌠ somσ oµ thσ member≤ arσ havinτá problem≤ ì
  7. creatinτá thei≥ owε librarie≤ oµ commonl∙ useΣ routines«á  A≤ yo⌡ ì
  8. kno≈á i⌠ i≤ oµ primar∙ importancσ t∩ havσ ß librar∙á oµá routine≤ ì
  9. tha⌠á yo⌡ don'⌠ havσ t∩ kee≡ writinτ ove≥ anΣ ove≥á again«á  Wheε ì
  10. yo⌡á writσ you≥ prograφ yo⌡ onl∙ havσ t∩ referencσ thσ routinσ a≤ ì
  11. an external and then use the routine freely in your program.
  12.  
  13.      Wσá arσá goinτá t∩á creatσ ß librar∙á oµá commonl∙á routine≤ ì
  14. presentl∙á founΣá iε thσ "┌ User≤ Groupó librar∙á anΣá cal∞á thi≤ ì
  15. new library ASL.REL (A Small Library).
  16.  
  17.      T∩ makσ ß librar∙ yo⌡ mus⌠ firs⌠ havσ ß subroutinσ assembleΣ ì
  18. int∩ ß .RE╠ file«  Iµ yo⌡ neeΣ hel≡ witΦ thi≤ procedure¼ thσ tex⌠ ì
  19. filσá MAKEREL.DO├ founΣ oε volumσ #▒ shoulΣ be most helpful.
  20.  
  21.      Ruεá thσá linke≥á bu⌠ ente≥ thσá librariaεá modσá b∙á typinτ ì
  22. /L:filename«  Sincσ wσ wan⌠ t∩ cal∞ ou≥ librar∙ AS╠ let≤ star⌠ b∙ ì
  23. typing:
  24.  
  25.      A>LINK /L:ASL
  26.  
  27.  
  28.      No≈á yo⌡á specif∙ thσ file≤ t∩ bσ includeΣ iεá thσá library«  ì
  29.                                     *** REMARKS ***
  30. *KEYIN                        found on volumes #3 and #4
  31. *CHAIN                        found on Pascal/Z library disk
  32. *INPORT                       found on volume #3
  33. *OUTPORT                      found on volume #3
  34. *DELAY                        found on volume #3
  35. *RANDOM                       found on volume #3
  36. *HALT                         found on this volume
  37. */E                           Typing /E closes the output file
  38.  
  39. NOTES:
  40.      Iµá yo⌡ makσ ß mistakσ yo⌡ caε alway≤ restar⌠ thσ linke≥á b∙ ì
  41. typing /R.
  42.      Iµá ß filσ witΦ thσ samσ namσ alread∙ exist≤ oε thσ disδá i⌠ ì
  43. wil∞ bσ deleteΣ anΣ theε ß ne≈ filσ wil∞ bσ created¼á s∩ bσá ver∙ ì
  44. carefu∞ a⌠ thi≤ step.
  45.      Thσá orde≥á oµá entr∙á int∩á thσá librar∙á ma∙á bσá oµá somσ ì
  46. importance«á  Sincσá thσ librar∙ i≤ loadeΣ iε onσ pass¼á ß modulσ ì
  47. shoulΣ appea≥ afte≥ i⌠ ha≤ beeε referenceΣ b∙ aε externa∞á symbo∞ ì
  48. iε othe≥ modules.
  49. .paè     No≈ i⌠ i≤ ß simplσ matte≥ t∩ usσ ou≥ ne≈ library«á  Let≤ usσ ì
  50. the routine KEYIN in a sample program.
  51.  
  52. Program DRead;
  53. { A program to directly read a char from the keyboard.}
  54.  
  55. LABEL 1;
  56. VAR  CH: CHAR;
  57.  
  58. Procedure KEYIN(VAR C:CHAR); EXTERNAL;
  59.  
  60. BEGIN
  61.   WHILE TRUE DO
  62.     BEGIN
  63.       WRITE('ENTER A CHARACTER ');
  64.       KEYIN(CH);
  65.       IF ( ORD(CH)=3 ) THEN GOTO 1;
  66.       WRITELN('YOU ENTERED A ',CH);
  67.     END;
  68. 1: {EXIT HERE ON CONTROL-C}
  69. END.{ of DREAD }
  70.  
  71.  
  72.      Now compile the program:
  73.  
  74. A>PASCAL DREAD.BBB
  75. A>ASMBL MAIN,DREAD.BB/REL
  76. A>LINK /N:B:DREAD B:DREAD ASL/S /E
  77.  
  78.  
  79.      That'≤ al∞ therσ i≤ t∩ itíá  Noticσ tha⌠ thσ ne≈ librar∙á i≤ ì
  80. oε thσ samσ disδ a≤ PASCAL.COM¼ ASMBL.COM¼ LIB.RE╠ AN─ LINK.COM« 
  81.  
  82.  
  83.      ╔á havσ writteε ß submi⌠ filσ tha⌠ wil∞ allo≈ yo⌡ t∩ compilσ ì
  84. ßá prograφá anΣ u≡ t∩ │ additiona∞ librar∙á files«á  Executσá thσ ì
  85. submi⌠ filσ likσ so:
  86.  
  87.      A>SUBMIT COMPILE PROGRAM DRIVE LIBRARY/S
  88.      A>SUBMIT COMPILE my PROGRAM on DRIVE using LIBRARY/S
  89.  
  90.  
  91.      We can compile and link our sample program in one step:
  92.  
  93.      A>SUBMIT COMPILE DREAD B ASL/S
  94.  
  95.      Isn'⌠á tha⌠ easyíá Thσ .CO═ filσ wil∞ bσ placeΣ oε thσá samσ ì
  96. drivσ a≤ thσ Pasca∞ sourcσ program«á  Notσ tha⌠ yo⌡ mus⌠ cal∞ fo≥ ì
  97. thσá librar∙á filσ witΦ thσ /╙ optioε elsσ yo⌡ loaΣ iε thσá wholσ ì
  98. library.
  99. .paèCall this file COMPILE.SUB
  100.  
  101. Pascal $1.$2$2$2
  102. asmbl main,$1.$2$2/rel
  103. ERA $2:$1.SRC
  104. link /n:$2:$1 $2:$1 $3 $4 $5 lib/s/E
  105. ERA $2:$1.REL
  106. :
  107. FILES $2:$1.*
  108.  
  109.  
  110. That'≤ al∞ fo≥ now«á  Iµ yo⌡ havσ an∙ question≤ fee∞ freσ t∩ cal∞ ì
  111. mσ o≥ dro≡ ß note«
  112.  
  113. RAYMOND E. PENLEY
  114. 1263 ALLEN COURT
  115. WALDORF, MD 20601
  116. (301) 645-9632  (evenings or weekends only)
  117. .paè