Sig/M   volume 43       8080 TINCMP Compiler and
                       Pidgin Programming System
                       CP/M-86 Bios Support

               -CATALOG.043    contents of Sig/M volume 43
                               released November 25, 1981
               ABSTRACT.043    abstract of Sig/M volume 43
               ACKLIST.043     acknowledgement file
               CRCKLIST.043    checksum of Sig/M volume 43

index   name            size    description

43.01   DESCRIP .DOC    16K     details of TINCMP and PIDGIN
43.02   IOCMPLX .ASM    19K     PIDGIN programming system
43.03   IOCMPLX .REL     2K          /
43.04   MACROS  .PGN     8K         /
43.05   PIDGIN  .S2M    10K        /
43.06   PIDGINLB.REL     1K       /
43.07   PIDMATH .ASM     5K      /
43.08   PIDMATH .REL     1K     /
43.09   STAGE2  .COM    12K     STAGE2 support system
43.10   SYSTEM  .ASM     1K     PIDGIN programming
43.11   SYSTEM  .REL     1K     /
43.12   TINCMP  .COM    17K     TINCMP compiler
43.13   TINCMP  .MAC    20K             /
43.14   TINCMP  .PGN    12K            /
43.15   TINCMP  .REL     5K           /
43.16   TINTEST1.PGN     3K          /
43.17   TINTEST2.PGN     3K         /
43.18   TINTEST3.PGN     1K        /
43.19   TINTEST4.PGN     3K       /
43.20   TINTEST5.PGN     2K      /
43.21   TINTEST6.PGN     2K     /
43.22   WC      .PGN     2K     TINCMP test program
43.23   WRNXT   .ASM     1K     PIDGIN console I/O
43.24   WRNXT   .REL     1K     /
43.25   CBIOS   .A86    17K     CP/M-86 Bios
43.26   GOCPM86 .ASM     1K      /
43.27   ERQ     .A86     3K     /
43.28   SD      .A86    15K     CP/M-86 directory sort

Copyright (C) 1981 by Sig/M-Amateur Computer Group
of New Jersey Inc., Box 97, Iselin NJ 08830-0097

READ THIS FIRST - BEFORE USE.
CALL TINCMP AS FOLLOWS:
       TINCMP MACROFILE,OUTPUTFILE,INPUTFILE
MACROFILE: THE MACROS TO BE USED AS TEMPLATES AND INSTRUCTIONS
OUTPUTFILE: THE OUTPUT OF TINCMP
INPUTFILE: THE INPUT TO BE EXPANDED BY TINCMP

REFERENCE FOR THIS STUFF:
       PIDGIN - A SYSTEMS PROGRAMMING LANGUAGE
       BY WM. A. GALE
       DOCTOR DOBBS JOURNAL #57 JULY 1981

       STAGE2
       8080 IMPLEMENTATION (SUPERB!)
       DICK CURTISS
       CP/MUG VOLUME 51

       IMPLEMENTING SOFTWARE FOR NON-NUMERIC APPLICATIONS
       WM. M. WAITE
       PRENTICE-HALL, INC.
       ENGLEWOOD CLIFFS, NJ 1973
       ISBN 0-13-451898-5 (ABOUT $25)

       AN 8080 IMPLEMENTATION OF PIDGIN
       TO BE PUBLISHED IN DR DOBBS
       SUBMITTED NOVEMBER 1981
       A. L. BENDER, M.D.


CONTENTS OF TINCMP DISK:
FILE    CONTENTS
--------------------------------------------------------------
MACROS.PGN      THE MACRO FILE USED TO TRANSLATE PIDGIN TO
               8080 ASSEMBLER CODE

PIDGIN.S2M      THE MACRO FILE USED TO TRANSLATE PIDGIN TO
               8080 ASSEMBLER CODE WHEN BOOTSTRAPPING FROM
               STAGE2 (THESE ARE STAGE2 MACROS)

TINCMP.PGN      THE TINCMP COMPILER SOURCE CODE IN PIDGIN.

TINCMP.MAC      THE OUTPUT OF TINCMP WHEN TRANSLATING TINCMP
               WRITTEN IN PIDGIN USING TINCMP.

TINCMP.REL      THE REL FILE FROM ASSEMBLING ABOVE FILE.

TINCMP.COM      TINCMP COMMAND FILE.

STAGE2.COM      STAGE2 MACRO PROCESSOR WRITTEN IN FLUB
               BY DICK CURTISS AND DISTRIBUTED HERE WITH
               HIS PERMISSION.

IOCMPLX.ASM     THE I/O SUBROUTINES FOR PIDGIN INCLUDING
               THE CP/M FILE CONTROL I/O INTERFACE ROUTINE

WRNXT.ASM       CONSOLE READ/WRITE ROUTINES FOR PIDGIN UNDER
               CP/M.

SYSTEM.ASM      THE CP/M DEFINITIONS FOR PIDGIN.  ALSO CONTAINS
               THE UNIVERSAL LOAD DE FROM M (LDEM) ROUTINE

PIDMATH.ASM     16 BIT INTEGER ARITHMETIC ROUTINES WRITTEN
               BY DICK CURTISS. SLIGHTLY MODIFIED TO BE USED
               WITH PIDGIN.

PIDGINLB.REL    RELOCATABLE LIBRARY OF WRNXT,SYSTEM AND PIDMATH.

TINTEST THRU
       TINTEST6 TEST ROUTINES FOR TINCMP.  USE IF YOU DESIGN YOUR
               OWN MACROS.

WC.PGN          WORD COUNTER.  USED AS A TEST PROGRAM TO CHECK THE
               TINCMP COMPILER.

SUMMARY FOR STAGE2:

       STAGE2 IS DOCUMENTED IN CPM/UG LIBRARY VOLUME 51.  PLEASE
READ THAT DOCUMENTATION IF YOU NEED DETAILED INSTRUCTIONS.  YOU
SHOULD ALSO BUY WAITE'S BOOK.  THIS IS A WELL WRITTEN, BUT COMPLEX
SUBJECT AND IS NOT CASUAL BED-TIME READING.  YOU WILL NEED TO READ AND
PROBABLY RE-READ EACH TOPIC SEVERAL TIMES TO MAKE SENSE OUT OF THINGS.

STAGE2 PRODUCES AN OUTPUT FILE FROM ONE OR MORE INPUT FILES.  IF
YOU WANT TO REGENERATE TINCMP.MAC FROM TINCMP.PGN YOU WILL NEED TO
DO SEVERAL THINGS.  ONE IS TO INSERT A SPACE IN FRONT OF EACH
TINCMP.PGN LINE WHICH STARTS WITH A NON-SPACE OR TAB.  INSERT
A SPACE BETWEEN BEGINMAIN AND ( IN THE SOURCE OR FIX THE S2M MACRO

NEXT, INSERT SPACES BEWEEN PACK AND ( AND UNPACK AND ( OR FIX THE
MACRO.  INSERT A FINIS STATEMENT AT THE END OF TINCMP.PGN.

       IF YOU CAN AVOID IT, DON'T GO BACK TO STAGE2.  JUST FIX THE
TINCMP MACRO FILE MACROS.PGN.  STARTING OVER WITH STAGE2 CAN GET
THE RESULTING COMPILER MESSED UP AND INTRODUCE ERRORS WHICH ARE
QUITE DIFFICULT TO FIND.  TO ASSEMBLE A NEW TINCMP WITH STAGE2:
       A>STAGE2  TINCMP.MAC,CON=PIDGIN.S2M,TINCMP.PGN
THIS PUTS THE BAD STATEMENTS OUT ON THE CONSOLE.  I REALLY CAN'T
SEE WHAT THIS WILL BUY YOU BUT YOU CAN USE IT IF YOU  WANT.

       WORKING WITH TINCMP CAN GET TO BE A DRAG SO IF YOU MAKE A SUBMIT
FILE THINGS WILL BE EASIER:
       1. COMPILATION AND ASSEMBLY TAKE ABOUT 5-7 MINUTES.
       2. TYPE-IN OF COMMANDS IS ERROR-PRONE BECAUSE OF THE NUMBER
               OF FILES USED.
       3. THERE ARE FEWER ERRORS WHEN FILES ARE SUBMITTED.

SUGGESTED SUBMIT FILE:
A>SUBMIT TINSUB
       TINCMP MACROS.PGN,$1.ASM,$1.PGN
       M80 ,=$1.ASM
       L80 $1,IOCMPLX,PIDGINLB/S,$1/N,/E

STAGE2 HAS MANY OTHER USES.  CONSULTING DICK CURTISS' FILES WILL
GIVE YOU SOME IDEA OF HOW POWERFUL STAGE2 IS.  UNLIKE TINCMP IT
HAS BRANCH AND TEST INSTRUCTIONS.  WAITE'S BOOK IS A GOOD EXAMPLE
OF HOW PRAGMATIC AND THEORETICAL MATERIAL CAN BE PRESENTED.

TO PUT TOGETHER A TINCMP COMPILER FOR SPECIAL PURPOSES:
       1. IF YOU DON'T HAVE M-80 OR RMAC:
       YOU NEED TO MERGE THE FOLLOWING:
               TINCMP.MAC
               IOCMPLX.ASM
               PIDMATH.ASM
               WRNXT.ASM
               SYSTEM.ASM
       REMOVE ALL EXTRN AND ENTRY STATEMENTS AS WELL AS DSEG, CSEG
       AND COMMON STATEMENTS.  REMOVE THE EXTERNAL PROCEDURE, LOCAL
       VARIABLE, ENDLOCAL STATEMENTS FROM MACROS.PGN
       REASSEMBLE - GOOD LUCK! YOU WILL NEED TO CHANGE ALL OF THE
       MACROS TOO.  YOU WILL REALLY NEED THE GOOD LUCK FOR THIS.
       2. IF YOU HAVE RMAC YOU NEED TO CHANGE THE ENTRY STATEMENTS
       TO PUBLIC IN ALL LIBRARY MODULES (IOCMPLX,WRNXT,PIDMATH,SYSTEM)
       3. IF YOU ARE NOT DARING AND HAVE AN ORG 100H SYSTEM YOU CAN
       JUST LOAD THE COM FILE TINCMP AND USE IT.
       4. IF YOU HAVE M-80:
       USE L80 TO LINK PIDGINLB INTO IOCMPLX AND TINCMP.  PIDGINLB
       IS A LIBRARY OF WRNXT,SYSTEM AND PIDMATH
       5. IF RUNNING MP/M SYSTEM DEFINES ?BOOT,?BDOS,?TBUF FOR CP/M
       AND YOU WILL NEED TO CHANGE THIS.
       6. IF RUNNING CP/M 2.2 EVERYTHING IS COOL.  I DIDN'T TEST THIS
       WITH CP/M 1.4 BUT I DIDN'T USE ANY WIERD CALLS SO IT SHOULD
       WORK OK.  THE FCB'S ARE ALL 36 BYTES LONG.
       7. IN THIS VERSION ALL FILES MUST BE DECLARED IN THE CONTROL
       STATEMENT AND ONLY THE ASSOCIATE FCB N WITH I$$ WORKS.
       8. ?ENDING WASN'T TESTED THROUGHLY.
       9. IOCMPLX IS REALLY WRITTEN FOR A Z-80 AND IF YOU HAVE ONE
       IT SHOULD BE RECODED.
       10: AS SUPPLIED, THE TINCMP COMPILER IS THE ACTUAL OUTPUT OF
       THE PIDGIN VERSION OF TINCMP AS SUPPLIED ON FILE TINCMP.PGN
       11: IF YOU WANT TO RESTART THE PROCESS LOTS OF LUCK YOU CAN
       GET A COPY OF TINCMP'S MOTHER STAGE2 IN CP/MUG VOL 51.
       12: IF YOU HAVE A Z-80 OR THE CDL ASSEMBLER YOU CAN CHANGE
       THE MACROS IN MACROS.PGN TO USE THEM.
       13: NOTE! NONE OF THE CODE IS OPTIMIZED.  YOU CAN SAVE ABOUT
       20-40% SPACE IN THE CSEG SEGMENTS BY HAND OPTIMIZING THE
       ASSEMBLY LANGUAGE IN TINCMP.MAC
       14: IF YOU HAVE PROBLEMS YOU CAN WRITE TO ME:
               A. L. BENDER, M. D.
               C/O NEUROLOGICAL SERVICES INC.
               336 CENTER AVE
               WESTWOOD NJ 07675
               201-664-4882
       15: THE MATERIAL HEREIN IS COPYRIGHTED (C) 1981.  MATERIAL
       IS PRESENTED FOR YOUR PRIVATE, NON-COMMERCIAL USE.  SOME
       OF THIS MATERIAL IS COPYRIGHT BY DICK CURTISS AND IS
       REPRODUCED HERE BY HIS WRITTEN PERMISSION (PIDMATH) AND
       TINCMP IS COPYRIGHT BY WM GALE.  THE REPRODUCTION OF THIS
       MATERIAL IN THIS LOCATION DOES NOT IMPLY ANY RIGHTS TO
       FURTHER PUBLISH, DISTRIBUTE, USE OR SELL ANY MATERIAL
       HEREIN PRESENTED.  BOTH WM GALE AND DICK CURTISS RETAIN ALL
       COPYRIGHT TO THEIR MATERIAL.  I RETAIN THE COPYRIGHT TO ALL
       MODIFICATIONS TO TINCMP AND TO THE CP/M VERSION OF TINCMP.
       ALTERING THE PROGRAMS BY HAND-OPTIMIZATION DOES NOT ALTER
       COPYRIGHT PROTECTION NOR DOES EXTENSION VOID THE RIGHTS OF
       PREVIOUS COPYRIGHT HOLDERS.
       PERMISSION FOR COMMERCIAL USE MUST BE OBTAINED FROM THE
       COPYRIGHT OWNERS INDIVIDUALLY.

                8080/Z80/8085 PIDGIN UNDER CP/M

                  By Andrew L. Bender, M. D.

    PIDGI� wa� describe� b� it� inventor�� Bil� Gale�� a� � "Lo� �
Leve� Programmin� Language"��  � suppos� tha� it� mai� attractio� �
t� m� whe� � firs� rea� abou� i� wa� it� structured� "C� languag� �
appearanc� an� it� simplicity�  I� ha� onl� on� drawbac� an� tha� �
wa� th� lac� o� � suitabl� 808� compiler��  Bil� ha� presente� � �
compile� fo� th� 650� whic� wa� detaile� enoug� t� star� th� �
projec� goin� o� thi� compute� bu� wa� no� reall� enoug� t� ge� �
th� projec� goin� o� othe� computers�  M� interes� wa� stirre� b� �
th� promis� o� � compiler-compile� i� � futur� issu� o� Dr� Dobb� �
writte� i� PIDGIN��  ɠ wa� intereste� i� compilin� � dat� �
definitio� languag� fo� anothe� projec� an� th� though� o� �
constructin� � compile� wit� th� rathe� primativ� tool� � ha� a� �
m�� disposa� wa� disturbing��  � realize� tha� i� ther� wa� � �
compile� compile� availabl� � woul� a� leas� b� abl� t� ge� �
starte� sinc� th� fron� en� o� th� compile� woul� b� complete� a� �
th� tim� th� languag� wa� defined.
    Th� tas� o� constructin� � PIDGI� compile� seeme� t� brea� �
dow� int� thre� distinc� tasks�  First� on� woul� hav� t� writ� � �
TINCMР compile� t� proces� PIDGI� language��  Second�� on� woul� �
hav� t� writ� al� o� th� suppor� routine� suc� a� th� I/Ϡ an� �
mat� functions��  Last�� th� PIDGI� progra� woul� hav� t� b� �
adapte� t� interfac� wit� th� CP/� environment��  Onc� TINCM� wa� �
u� an� running�� i� coul� b� use� t� compil� itsel� an� othe� �
program� a� needed��  Al� thre� task� ha� t� b� complete� firs� �
before TINCMP could be made to work.
    A� firs� i� seeme� tha� codin� TINCM� woul� b� th� mos� �
difficul� tas� o� th� thre� an� i� reall�� prove� t� b� th� �
simples� task��  Codin� th� I/� routine� too� abou� 60� o� th� �
developmen� tim� becaus� th� thir� task�� th� CP/M fil� contro� �
interfac� too� � lon� tim� t� desig� an� test��  A� overal� pla� �
wa� mad� base� o� th� I/� structur� o� th� compile� a� presente� �
b� Bil� Gale�  � spok� wit� Bil� abou� th� I/� structur� an� som� �
change� whic� � ha� propose� bu� bot� o� u� agree� tha� i� woul� �
hav� change� th� overal� desig� o� th� languag� whic� ha� bee� �
alread�� published��  � decide� t� kee� th� structur� unchange� �
eve� thoug� th� us� o� buffe� are� t� fil� association� seeme� t� �
be rather unusual constructions.
    Considerin� th� availabl� tool� fo� th� constructio� o� �
TINCMP'� firs� 808� realizatio� � discarde� BASIà becaus� i� �
woul� hav� bee� � difficul� languag� t� ge� thing� goin� in��  I� �
di� offe� eas� o� debuggin� bu� waitin� fo� i� t� chu� throug� � �
fe� line� o� PIDGI� seeme� t� b� � bi� drawback��  Afte� al� her� �
wa� a� interprete� (BASIC�� interpretin� anothe� interprete� �
(TINCMP)��  Th� nex� languag� whic� wa� seriousl� considere� wa� �
FORTRAN�  � didn'� loo� int� thi� carefull� becaus� � fel� tha� � �
wouldn'� lear� muc� doin� i� i� FORTRA� an� th� lac� o� strin� �
manipulatio an� automati� typ� conversion� seeme� t b� �
undesired��  � wa� the� thinkin� of � highe� languag� - d� i� i� �
PL/I-8�� � thought��  � discarde� thi� ide� becus� � reall�� fel� �
tha� � kne� s� littl� abou� PL/� tha� � woul� b� spendin� al� o� �
m�� tim� educatin� mysel� an� woul� neve� ge� th� jo� done��  � ��the� sai� t� myself�� "Self�� yo� hav� bee� writin� assembl� �
languag� fo� th� pas� 2� years�� wh� no� d� i� i� assembl� �
language?��  Sinc� n� answe� wa� forthcomin� � almos� bega� t� d� �
i� i� MACRO-8� whe� � wen� t� � loca� compute� clu� meetin� an� �
wa� fortunat� enoug� t� obtai� � cop� o� th� CP/͠ Use� Grou� �
Librar� Volum� 51�  � wa� woolgatherin� on� afternoo� rearrangin� �
al� o� m� librar� disk� whe� � cam� acros� thi� dis� an� notice� �
tha� i� containe� � "powerfu� macr� processor"��  � smal� ligh� �
wen� o� an� � printe� ou� al� o� th� documentation�  I� wa� clea� �
tha� thi� macr� processo� wa� no� onl�� powerfu� enoug� t� �
directl� proces� PIDGIN� i� wa� � membe� o� th� famil� fro� whic� �
TINCMР wa� derived��  STAGE�� wa� the� th� answer��  STAGE2� �
implemente� b� Richar� Curtis� an� derive� fro� SIMCMР wa� th� �
featur� progra� o� CP/MU� volum� 51��  � studie� M� Curtiss� �
documentatio� fo� severa� day� the� � ra� ou� t� Prentice-Hal� �
an� bough� Wm�� Waite'� Boo� "Implementin� Softwar� fo� Non-�
Numeric Applications".
    Afte� � wee� o� so�� � ha� � se� o� workin� macro� whic� �
permitte� m� t� pu� i� PIDGI� languag� an� ge� ou� code��  ɠ ha� �
TINCMР u� i� assembl� cod� i� exactl� nin� days��  Gettin� th� �
macro� writte� wa� slow��  � figur� tha� � spen� abou� 30� o� th� �
overal� tim� wit� th� STAGE� an� TINCMРmacros�� Th� remainin� �
tim� wa� spen� wit� sundr� item� lik� fixin� th� lin� fee� �
proble� i� TINCMP�  TINCM� assume� tha� � ne� lin� ca� b� define� �
b� � singl� characte� whil� CP/� need� � tw� characte� sequence� �
Carriag� return�� lin� feed��
    B�� usin� Dic� Curtiss� intege� arithmeti� packag� ɠ didn'� �
nee� t� d� tha� wor� ove� again��  � jus� adde� th� prope� entr� �
point� an� assemble� it��  Unlik� mos� fre� librar� program� i� �
worke� a� once��  Whil� � didn'� nee� al� o� th� subroutine� i� �
th� package�� � lef� the� i� ther� i� cas� anyon� wante� t� us� �
them for other purposes.
    � trie� t� ge� TINCM� u� an� finally� afte� � serie� o� ver� �
strang� bugs�� introduce� b� m� poo� macr� code�� � actuall� go� �
th� dam� compile� t� tur� ou� � fe� line� o� code��  Tw� mor� �
macr� error� fixe� an� TINCM� writte� i� STAGE�� coul� compil� �
itsel� i� PIDGIN��  I� wa� quit� thrillin� t� se� th� compile� �
actually work as Bill Gale promised in his July 1981 article.
    ɠ wa� the� read� fo� th� bi� problem�� Shoul� � handl� cod� �
generatio� a� Bil� di� o� shoul� � tur� ou� assembl�� languag� �
cod� again��  � reall� gav� thi� questio� som� seriou� thought�  �
I� ɠ di� tur� ou� assembl� languag� cod� i� woul� hav� t� b� �
assemble� b�� a� assemble� an� � woul� hav� t� assum� � mor� o� �
les� "standard� assemble� whic� everyon� woul� hav� or�� a� leas� �
mos� peopl� woul� have��  � though� o� turnin� ou� AS� code�  AS� �
i� th堠 Digita� Researc� assemble� supplie䠠 wit蠠 CP/M�  �
Unfortunatly�� AS� doe� no� mak� relocatabl� cod� an� generatio� �
o� absolut� cod� didn'� see� worthwhil� sinc� � wante� t� b� abl� �
t� us� librar� routine� whic� coul� b� loade� anyplac� i� memor� �
t� mak� u� fo� thos� CP/� system� whic� di� no� hav� zer� origin� �
o� thei� TP� beginnin� a� 100H��  I� � wante� t� approac� th� �
proble� a� Bil� Gal� di� ther� wer� othe� problems��  Th� 808� �
hardwar� ha� n� relativ� addressin� a� doe� th� 650� o� 6800��  � �
decide� tha� th� lac� o� thi�  hardwar� facilit�� mad� cod� �
generatio� wit� TINCM� difficult��  Microsoft'� M-8�� assemble� ��seeme� fairl� ubiquitou� an� tha� i� was�� i� al� tru� respects� �
compatibl堠 wit� th� RMAà assemble� o栠 Digita젠 Research�  �
Generatin� assemble� cod� ha� severa� othe� problem� associate� �
with it.
    Lookin� a� th� TINCM� compiler�� on� notice� tha� ther� ar� �
man� possibilitie� fo� generatin� label� whic� loo� lik� o� code� �
o� pseudo-operation� i� th� assembler��  808� assembler� alway� �
see� t� defin� th� register� a� symbol� s� tha� i� yo� defin� S� �
a� � byt� i� � PIDGI� progra� ther� i� ever� reaso� t� firml� �
beleiv� tha� i� wil� blo� th� assignmen� o� th� stac� pointe� �
symbo� "SP"��  Al� o� thes� problem� ca� b� avoide� b� prefixin� �
eac� symbo� i� th� outpu� o� th� cod� generato� wit� som� �
characte� whic� doesn'� loo� lik� anythin� th� assemble� woul� �
expec� i� a� interna� symbo� o� op-code��  � choos� � do� fo� �
this��  B� prefixin� almos� everythin� wit� � dot�� conflict� ar� �
avoide� an� th� symbol� ar� alway� unique��  Subroutin� name� ar� �
prefixe� wit� tw� dot� t� kee� the� diffe
ren� fro� variabl� name� �
i cas� ther� ar� intersection� betwee� th� two���  Thes� �
intersection� ar� no� specificall� prohibite� b� PIDGIN��  Syste� �
symbol� an� jum� target� ar� labelle� wit� � leadin� questio� �
mark���
    Becaus� TINCM� canno� tes� o� branch�� certai� construction� �
ar� peculiar��  Tak� fo� exampl� th� CHOOS� ON/CAS� construction�  �
eac� tim� � CAS� i� encountere� i� th� inpu� fil� PIDGIΠ shoul� �
generat� � jum� t� th� ENDCHOOS� labe� bu� no� th� firs� tim� �
tha� CAS� i� encountere� afte� th� CHOOS� ON�  Sinc� ther� ar� n� �
tes� facilities� th� jum� i� generate� o� ever� occurenc� o� CAS� �
bu� o� th� firs� occurance�� a� OR� $-� obliterate� th� generate� �
JMР ENDCHOOS� instruction��  Thi� i� don� b� pushin� � � o� th� �
stac� a� CHOOS� O� bu� zer� thereafte� eac� tim� � CAS� statemen� �
i� noted��  Thi� valu� i� poppe� of� th� stac� an� use� a� th� �
valu� i� th� ORǠ statemen� resultin� i� a� ORǠ $-�� o� al� �
subsequen� call� fo� CASE��  Ther� ar� als� n� rea� possibilitie� �
fo� cod� optimization���  Perhap� someon� ca� writ� � pos� �
compilatio� optimize� fo� TINCMP - naturally in PIDGIN.
    A� a� ai� t� program� operatin� unde� differen� environment� �
th� CP/� implementatio� o� PIDGI� call� � librar� subroutin� a� �
th� beginnin� o� PIDGI� progra� executio� an� a� th� terminatio� �
o� PIDGI� progra� execution��  Th� beginnin� subroutin� i� calle� �
?INI� an� th� concludin� subroutin� i� calle� ?ENDING��  Bot� o� �
thes� routine� ar� i� th� IOCMPL� subroutine��  ?INIԠ transfer� �
fil� name� fro� th� contro� statemen� t� � se� o� FCB'� i� �
IOCMPL� an� store� th� numbe� o� thes� fil� name� i� AC�  ?ENDIN� �
close� an� ope� file� an� return� contro� t� th� use� program�  � �
jum� t� ?BOO� alway� follow� th� CAL� ?ENDIN� statemen� whe� th� �
PIDGI� statemen� ENDMAI� i� encountered��  I� you� hear� desires� �
yo�� ca� chang� thes� routine� t� d� anythin� yo� fee� necessar� �
in your particular system.
    Variable� declare� i� BYT� o� IN� statement� ar� alway� �
place� i� blan� commo� storage��  Thi� facilitate� thei� us� wit� �
a� undocumente� featur� and�� bein� honest�� totall�� unteste� �
feature��� whic蠠 allow� independen� compilatio� o栠 progra� �
subroutines��  ɠ expec� thi� featur� t� b� read� i� abou� thre� �
month� time�  I� wil� no� mak� previou� PIDGI� program� unusable�  �
� furthe� extensio� t� b� use� i� mai� program� o� subroutine� i� ��th� LOCA̠ VARIABLEӠ statemen� an� ENDLOCA̠ statement��  An� �
variable� declare� b� eithe� BYT� o� IN� statement� betwee� thes� �
tw� statement� ar� no� pu� i� commo� an� ar� LOCA� t� th� curren� �
compilation.  All other variables are global.
    Afte� � fe�� discussion� wit� Bil� Gale�� th� PARAMETE� �
statemen� wa� born�  Th� PARAMETE� statemen� allow� yo� t� defin� �
i� � singl� locatio� al� o� th� syste� dependen� variable� fo� � �
program���  Th� paramete� statemen� ha� th� followin� form� �
PARAMETE� K$$=$$$�� K$� i� th� symboli� paramete� ter� an� $$� i� �
th� numerica� equivalent�  T� us� th� parametri� variabl� K$� yo� �
nee� th� $$=+K$� statemen� o� th� I$$=+K$� statement�  A� exampl� �
o� th� us� o� thi� statemen� i� i� TINCMР itsel� wher� th� �
variable� L� (lin� feed)�� N� (carriag� return� an� EƠ ar� al� �
defined by means of parameter statements.
    Gettin� CP/͠ linke� u� wit� th� internal� o� PIDGI� wa� � �
rathe� difficul� task��  � di� no� wis� t� mak� havo� ou� o� th� �
fil� syste�  use� b� PIDGI� ye� CP/� neede� � fil� nam� rathe� �
tha� � bloc� locatio� t� locat� th� tex� o� � fil� o� t� �
determin� wher� tex� wa� t� b� written��  I� orde� t� lin� u� �
bloc� number� wit� fil� name� � decide� tha� � fictitiou� bloc� �
numbe� wa� goin� t� b� use� a� � fil� identifie� insid� PIDGIN�  �
Thi� identifie� woul� b� associate� wit� � fil� nam� b�� a� �
associat� statemen� whic� neede� t� b� designed��  Th� associat� �
statemen� wa� bor� afte� considerabl� though� bu� i� i� obviou� �
tha� i� i� ver�� limitin� i� scop� an� probabl�� shoul� b� �
redesigne� t� b� mor� general��  Th� for� o� th� associat� �
statemen� i� ASSOCIAT� FC� � WIT� I$$��  Thi� allow� th� firs� �
paramete� whic� i� th� fil� mentione� i� tha� locatio� o� th� �
contro� statemen� t� b� associate� wit� bloc� numbe� I$$�  � onl� �
use� th� lowe� seve� bit� o� I$� a� � bloc� number/fil� numbe� s� �
onl�� thes� bit� nee� b� uniqu� fo� eac� file��  Th� eigt� bit� �
whil� transcribe� int� th� I/� subroutine� shoul� b� zer� fo� �
furthe� expansion�  If you had a control statement:
    AAB.AAA,BBB.CCC,DDD.EEE
an� you� paramete� � i� th� associat� statemen� wa� � thi� woul� �
resul� i� th� associatio� o� BBB.CCà wit� th� fil� numbe� �
containe� i� th� lo� orde� seve� bit� o� I$$��  Thi� associatio� �
reques� mark� th� fil� a� "prepared� i� a� interna� tabl� i� th� �
I/� complex��  Anothe� for� o� th� associat� statement�� no� ye� �
implemente� i� th� I/� comple� subroutine� i� th� form� ASSOCIAT� �
FILŠ $�� WIT� I$$��  Th� firs� paramete� i� suppose� t� b� th� �
star� o� 1� byte� definin� th� driv� an� the� th� eleve� byt� �
fil� nam� an� extensio� fo� � particula� file��  Unuse� byte� ar� �
t� b� se� t� blanks��  Thi� routin� wil� als� mar� th� fil� a� �
prepared��  Fo� furthe� detail� yo� shoul� refe� t� th� IOCMPL� �
assembly listing.
    Specificall� no� implemente� ar� th� statement� READBUƠ an� �
WRITEBUF��  Althoug� ther� i� nothin� difficul� abou� thes� �
statement� the�� wer� no� necessar� fo� th� implementatio� o� �
TINCM� an� s� � didn'� cod� them��  Th� statement� LOMEM�� HIME� �
an� REGISTE� ar� no� implemented�  Thes� statement� hav� n� plac� �
i� � relocatabl� progra� whic� doesn'� hav� � zer� page��  I� yo� �
wan� yo�� ca� pu� thes� statement� int� th� macr� template� �
without any action occuring when they are recognized.
    I� programmin� TINCM� � firs� wante� t� ge� i� u� o� a� 808� ��becaus� tha� processo� i� � subse� o� th� 808� an� Z-80�  I� use� �
cod� wil� ru� o� th� 808� i� wil� probabl� ru� o� th� othe� �
processors��  Muc� cod� ca� b� optimize� i� TINCM� i� writte� fo� �
� Z-80��  Th� I/� comple� especiall� wil� b� cleane� o� � Z-8� �
than it is on the 8080.
    808� TINCM� an� al� o� th� associate� routine� ar� availabl� �
throug� th� SIG/� librar� o� b� direc� mai� fro� th� author��  � �
wil� prepar� � singl� density�� eigh� inc� CP/� forma� dis� an� �
mai� th� sam� o� receip� o� � mone� order�� chec� o� 2�� cen� �
stamp� fo� $25�� U� Funds��  I� yo� se� thi� afte� 1982�� bette� �
writ� firs� a� Bil� Gal� says��  I� yo� decid� t� implemen� thi� �
processo� fo� othe� machine� an� fee� ɠ coul� help�� don'� �
hesitat� t� write��  STAGE� i� distribute� wit� TINCM� b� specia� �
arrangemen� wit� Richar� Curtiss��  Th� distributio� o� an� �
material� o� thi� dis� d� no� alte� th� curren� copyrigh� statu� �
o� an� o� th� material��  Permissio� i� grante� t� distribut� o� �
mak� a� man� copie� a� desire� fo� non-commercia� use��  Th� �
remaining rights are retained by the individual authors.