LIBRARY MAINTENANCE
by Ray Penley
W� hav� foun� tha� som� o� th� member� ar� havin� problem� �
creatin� thei� ow� librarie� o� commonl� use� routines�� A� yo� �
kno�� i� i� o� primar� importanc� t� hav� � librar�� o� routine� �
tha� yo� don'� hav� t� kee� writin� ove� an� ove� again�� Whe� �
yo�� writ� you� progra� yo� onl� hav� t� referenc� th� routin� a� �
an external and then use the routine freely in your program.
W� ar� goin� t� creat� � librar�� o� commonl�� routine� �
presentl�� foun� i� th� "� User� Group� librar�� an� cal� thi� �
new library ASL.REL (A Small Library).
T� mak� � librar� yo� mus� firs� hav� � subroutin� assemble� �
int� � .RE� file� I� yo� nee� hel� wit� thi� procedure� th� tex� �
fil� MAKEREL.DO� foun� o� volum� #� shoul� be most helpful.
Ru� th� linke� bu� ente� th� libraria� mod� b�� typin� �
/L:filename� Sinc� w� wan� t� cal� ou� librar� AS� let� star� b� �
typing:
A>LINK /L:ASL
No�� yo�� specif� th� file� t� b� include� i� th� library� �
*** REMARKS ***
*KEYIN found on volumes #3 and #4
*CHAIN found on Pascal/Z library disk
*INPORT found on volume #3
*OUTPORT found on volume #3
*DELAY found on volume #3
*RANDOM found on volume #3
*HALT found on this volume
*/E Typing /E closes the output file
NOTES:
I� yo� mak� � mistak� yo� ca� alway� restar� th� linke� b� �
typing /R.
I� � fil� wit� th� sam� nam� alread� exist� o� th� dis� i� �
wil� b� delete� an� the� � ne� fil� wil� b� created�� s� b� ver� �
carefu� a� thi� step.
Th� orde� o� entr�� int� th� librar�� ma�� b� o� som� �
importance�� Sinc� th� librar� i� loade� i� on� pass�� � modul� �
shoul� appea� afte� i� ha� bee� reference� b� a� externa� symbo� �
i� othe� modules.
pa
� No� i� i� � simpl� matte� t� us� ou� ne� library�� Let� us� �
the routine KEYIN in a sample program.
Program DRead;
{ A program to directly read a char from the keyboard.}
LABEL 1;
VAR CH: CHAR;
Procedure KEYIN(VAR C:CHAR); EXTERNAL;
BEGIN
WHILE TRUE DO
BEGIN
WRITE('ENTER A CHARACTER ');
KEYIN(CH);
IF ( ORD(CH)=3 ) THEN GOTO 1;
WRITELN('YOU ENTERED A ',CH);
END;
1: {EXIT HERE ON CONTROL-C}
END.{ of DREAD }
Now compile the program:
A>PASCAL DREAD.BBB
A>ASMBL MAIN,DREAD.BB/REL
A>LINK /N:B:DREAD B:DREAD ASL/S /E
That'� al� ther� i� t� it�� Notic� tha� th� ne� librar�� i� �
o� th� sam� dis� a� PASCAL.COM� ASMBL.COM� LIB.RE� AN� LINK.COM�
ɠ hav� writte� � submi� fil� tha� wil� allo� yo� t� compil� �
� progra� an� u� t� � additiona� librar�� files�� Execut� th� �
submi� fil� lik� so:
A>SUBMIT COMPILE PROGRAM DRIVE LIBRARY/S
A>SUBMIT COMPILE my PROGRAM on DRIVE using LIBRARY/S
We can compile and link our sample program in one step:
A>SUBMIT COMPILE DREAD B ASL/S
Isn'� tha� easy�� Th� .CO� fil� wil� b� place� o� th� sam� �
driv� a� th� Pasca� sourc� program�� Not� tha� yo� mus� cal� fo� �
th� librar�� fil� wit� th� /� optio� els� yo� loa� i� th� whol� �
library.
pa
�Call this file COMPILE.SUB
Pascal $1.$2$2$2
asmbl main,$1.$2$2/rel
ERA $2:$1.SRC
link /n:$2:$1 $2:$1 $3 $4 $5 lib/s/E
ERA $2:$1.REL
:
FILES $2:$1.*
That'� al� fo� now�� I� yo� hav� an� question� fee� fre� t� cal� �
m� o� dro� � note�
RAYMOND E. PENLEY
1263 ALLEN COURT
WALDORF, MD 20601
(301) 645-9632 (evenings or weekends only)
pa
�