home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / f83 / readme.pc < prev    next >
Text File  |  1985-02-09  |  18KB  |  406 lines

  1. .PO 3
  2.  
  3.     WELCOME TO FORTH  
  4.  
  5.      This   is  a  public  domain  system,   and  may  be  freely 
  6. distributed and copied,  as long as the authors are given  credit 
  7. and  no copyright notice is placed upon it.  If we catch  someone 
  8. selling this system as their own proprietary product,  with their 
  9. copyright notice , we will do our best to make them regret it for 
  10. the  rest  of their lives.  You have been  warned!!     
  11.  
  12.      This  Forth  uses the files of the  host  operating  system. 
  13. Although  this reduces performance,  it is much more portable and 
  14. more convenient for novices.  The use of files will be  described 
  15. later.
  16.  
  17.      This  disk contains some Huffman encoded files.  They  allow 
  18. the  system  to fit on one floppy disk.   Your first task  is  to 
  19. expand  them  into the source files for the system.  The  Huffman 
  20. files and their expansions are: 
  21.  
  22. M86.HUF        -->       META86.BLK
  23. K86.HUF        -->       KERNEL86.BLK 
  24. E86.HUF        -->       EXTEND86.BLK
  25. C86.HUF        -->       CPU8086.BLK
  26.  
  27. UT.HUF         -->       UTILITY.BLK
  28. HF.HUF         -->       HUFFMAN.BLK
  29. CK.HUF         -->       CLOCK.BLK
  30. FX.HUF         -->       F83-FIXS.TXT
  31.  
  32. In addition there are a few non-compressed files.   These are the 
  33. following:
  34.  
  35. README.PC     This file which you are hopefully reading.
  36. RUNME.COM     The file that you will run to create the BLK files.
  37. EXPAND86.BLK  The file used to expand the HUF files.
  38.  
  39.      In  order  to recover the actual source  code,  simply  type 
  40. RUNME  and  follow  the  directions.    If  all  goes  well,  the 
  41. corresponding  BLK files will be created.   You should of  course 
  42. make  backup  copies of the expanded source code as  soon  as  it 
  43. exists.   We apologize for the time the expansion takes, but such 
  44. is life.   You are now in a position to modify and regenerate the 
  45. system.
  46.  
  47.      To  do  so,  you should put META86.BLK and  KERNEL86.BLK  on 
  48. drive B:, and put F83.COM on drive A:. Make sure there is room on 
  49. A:  for the new KERNEL.COM,  then log onto drive B:  and type the 
  50. following:
  51.  
  52. B>A:F83 META86.BLK ( run F83 on META86.BLK )
  53. OK ( loads meta compiler and generates KERNEL.COM )
  54. BYE ( return to CP/M )
  55.  
  56.      Now you have a new KERNEL.COM on A: and you are ready to add èthe selected extensions and make a new F83.COM ( you did back  up 
  57. the  old one didn't you?).  Put  EXTEND86.BLK,  CPU8086.BLK,  and 
  58. UTILITY.BLK on A: with KERNEL.COM and type the following:
  59.  
  60. A>KERNEL EXTEND86.BLK ( run KERNEL86 on EXTEND86.BLK )
  61. OK ( loads all extensions and creates new version of F83.COM )
  62. BYE ( return to CP/M )
  63.  
  64. You  can have a printout of these instructions by using Control P 
  65. and entering TYPE README.86
  66.  
  67.      In  what  follows  the <CR> symbol represents  the  carriage 
  68. return  key  on  your terminal.  To enter  Forth  from  the  CP/M 
  69. environment,  insert  the  disk containing the F83.COM file  into 
  70. drive A of your computer,  (after booting it of course) and  type 
  71. F83<CR>
  72.  
  73.      Forth will reply with:
  74.  
  75. 8086 Forth 83 Model 2.0.0
  76. Modified 01Apr84
  77.  
  78.      Forth  is about ten years old now (in 1983) but some of  the 
  79. features  of F83 are relatively new to this Public  Domain  Forth 
  80. Model.
  81.   
  82.      The VIEW command is one of the best.  VIEW <word> <CR>  will 
  83. find  the screen that contains the code for the <word>,  provided 
  84. that  the  file that contains <word> is on the  currently  logged 
  85. disk  drive.  If you can fit all of the source code on  a  single 
  86. drive,  VIEW works great,  and takes care of opening the file and 
  87. displaying  the screen for you.   A recent addition to the system 
  88. is the word FIX which combines the function of VIEW with that  of 
  89. the  editor.   To use it type FIX <word> <CR> and the screen upon 
  90. which that word resides will be made available for editing,  with 
  91. the editing cursor placed following the first occurance of <word> 
  92. on that screen.  
  93.  
  94.      We  have  also  tried to make extensive use  of  the  shadow 
  95. screen  concept.  In this regard,  the word A moves you from  the 
  96. current  screen  to  its associated  shadow  screen.  The  SHADOW 
  97. vocabulary  contains  a  bunch  of  words  that  are  helpful  in 
  98. maintaining  shadow screens.  COPY allows you to copy not only  a 
  99. screen,  but also its associated shadow.  SHOW allows you to list 
  100. each  source screen across from its shadow when you want to print 
  101. them.  Finally  CONVEY allows you to move groups of  screens  and 
  102. their  associated  shadows.  To see what words are in the  SHADOW 
  103. vocabulary simply type SHADOW WORDS<CR>
  104.  
  105.      There  is  also  a decompiler  present  which  reverses  the 
  106. compiling  process,  producing source code from object code.  The 
  107. user  interface to it is the word SEE <name> where <name> is  the 
  108. name of a Forth word you wish to decompile. While the information 
  109. SEE gives you is not as complete as that given by VIEW,  a  least 
  110. it is always available, and not dependent upon whether or not the ècorrect file is present on the currently logged disk drive. For a 
  111. real  experience  try decompiling the words STATUS,  which  is  a 
  112. DEFERred  word,   ie  an  execution  vector.   SEE  calls  itself 
  113. recursively in this case and tracks down the definition. This can 
  114. be quite handy.
  115.  
  116.      To  see a list of the words that are in the dictionary  type 
  117. WORDS. You will see lots of words. Each is a command and each can 
  118. be VIEWed.  WORDS will stop if you hit any key.  You can look  at 
  119. the word SHOW by typing VIEW SHOW.  Assuming all is well you will 
  120. see  a Forth screen containing the definition of SHOW along  with 
  121. some other words. Type A L (cr) and you will be rewarded with the 
  122. Shadow screen that goes with it. A L (cr) will Alternate List you 
  123. back to the original screen of code.  Look at it and when you see 
  124. a word that doesn't seem fully self evident, VIEW it and read the 
  125. shadow  screen.  The  word SHOW and its source code that we  have 
  126. been viewing,  is a command that prints out three source  screens 
  127. along  with  three shadows for a total of six screens  per  page. 
  128. There  are  two  versions  of SHOW.  The vocabulary  you  are  in 
  129. determines  how  SHOW will print out.  If you are in  the  SHADOW 
  130. vocabulary,  six screens of code and shadows will print.  If  you 
  131. are in FORTH 6 screens of code will be printed.
  132.  
  133.      Now for some more commands.  N is next screen and L is list. 
  134. N L lists the next screen and B L lists the next screen  back.  N 
  135. ED will edit the next screen etc. Now lets printout a few screens 
  136. that  will  detail  some of the editor commands.  Most  are  from 
  137. Starting Forth but some are new ones.
  138.  
  139. Type this: EDITOR VIEW JOIN<CR>
  140.  
  141.      You are looking at a screen of editing commands.  Lets go to 
  142. the shadow with the A L command and do some exploring.  While  we 
  143. are  in  the  shadows lets look at the next five  or  six  shadow 
  144. screens  that  should be editor words.  Use N L.  If you  have  a 
  145. printer  you  may print these screens now as follows.  Type  VIEW 
  146. WIPE  for example.  If wipe is the first of 6 screens  of  editor 
  147. words remember the screen number.  If for instance it was 80 then 
  148. type 80 85 SHADOW SHOW<CR>
  149.  
  150.      Now  a  brief word about our mass  storage  interface.   Our 
  151. Forth  83 system runs as a guest under a host system's  operating 
  152. system.   Because  of  this,  we use the host's  file  system  to 
  153. contain  our screen files.   Screens are implemented as 1K blocks 
  154. within  a random access file.   Screens are still treated  as  16 
  155. lines  of 64 characters when editing,  with no embedded  carriage 
  156. returns or line feeds.   In order to access a screen file it must 
  157. first be opened.   This can be done in two ways.  The most common 
  158. is  to  specify the name of the screen file on the execute  line.  
  159. Thus  if you wanted to open MY.BLK you could fire up  Forth  with 
  160. the following:
  161.  
  162. A>F83 MY.BLK<CR>
  163. .paèOnce  you are in Forth,  you can open other files with the  Forth 
  164. word OPEN <name> where <name> is the name of the file you wish to 
  165. open.   OPEN is a defining word,  and creates a dictionary  entry 
  166. using the file name.   Once a file is opened BLOCK references are 
  167. relative  to the beginning of the currently open file.   After  a 
  168. file  has been opened with OPEN,  it may be reopened by executing 
  169. the  file  name.   This is very fast,  since only  a  pointer  is 
  170. changed  in  memory.   One note,  block 0 is still treated  as  a 
  171. special case, and hence can't be loaded.
  172.  
  173.                          FORTH EXAMPLES
  174.  
  175.      We  would  like to answer some of the most frequently  asked 
  176. questions  about the F83 system at this point.   The best way  to 
  177. gain familiarity with the system is to fire it up and try out the 
  178. following examples.   We will indicate the text that you type  in 
  179. as upper case text.   The text in parentheses are our comments on 
  180. what is going on.  The <CR> indicates carriage return, as usual.
  181.  
  182. F83<CR> ( fire up forth from the CP/M environment )
  183. 8086 Forth 83 Model 2.0.0 ( Forth's reply and )
  184. Modified 01Apr84          ( sign on message )
  185. WORDS<CR>
  186. empty mark hello ....
  187. 10 CREATE-FILE SAMPLE.BLK<CR> ( Creates a file called SAMPLE.BLK )
  188.                               ( which is 10 screens big. )
  189. 1 LIST<CR>
  190. Scr# 1
  191.   0
  192.   1
  193.   2      ( This will be a blank screen )
  194.   ...
  195.  15
  196.  
  197. ( Now we will edit screen 1 with the default dumb terminal )
  198. ( editor which is pre-installed for you.  Your first task is )
  199. ( to install the cursor addressing routines to make the editor )
  200. ( more convenient to use )
  201.  
  202. 1 EDIT<CR>
  203. Enter your id: ..........   
  204.    ( Your id is a 10 character string that will automatically )
  205.    ( be placed in the upper right hand corner of line 0 of the )
  206.    ( current screen you are editing if you modify that screen )
  207.    ( I usually enter the date and my initials as follows: )
  208. 10MAR84HHL<CR>
  209.    ( The screen will be blanked and listed, you should have )
  210.    ( a result similar to 1 LIST above,  but with the line ) 
  211.    ( number also appearing on the right hand side of the screen )
  212.  
  213.    ( Now we will enter the source code necessary to install )
  214.    ( the cursor routine drivers for an ADM-3A terminal )
  215. .paè0 NEW<CR> 
  216.    ( This allows us to enter multiple lines of text.  The text )
  217.    ( input is terminated with a null line.  After each line is )
  218.    ( entered, it is redisplayed for you )
  219. \ CURSOR ROUTINES FOR AN ADM-3A TERMINAL<CR>
  220.    ( it is best to use line 0 for a comment )
  221. EDITOR DEFINITIONS<CR> 
  222.    ( This will add the following definitions to the editor )
  223. : ADM-AT<CR>
  224.    27 EMIT  ASCII = EMIT   32 + EMIT   32 + EMIT  ;<CR>
  225. : ADM-DARK<CR>
  226.    CONTROL Z EMIT   ;<CR>
  227. : ADM-3A<CR>
  228.    ['] .ALL      IS  .SCREEN <CR>
  229.    ['] ADM-AT    IS  AT <CR>
  230.    ['] ADM-DARK  IS  DARK <CR>
  231.    ['] NOOP      IS  -LINE <CR>
  232.    ['] (BLOT)    IS  BLOT ; <CR>
  233. ADM-3A <CR>
  234. <CR>
  235. DONE<CR>
  236. 1 modified
  237.    ( Typing that last <CR> will return you to Forth. The DONE )
  238.    ( command will write the text you entered to the disk, and )
  239.    ( exit from the editing environment )
  240.    ( To install the ADM-3A drivers you need now just type: )
  241. 1 LOAD<CR>
  242.    ( Now the editor will work the way it was intended to )
  243.    ( with the current screen image always displayed at the )
  244.    ( top of the screen, and the line you are entering at the )
  245.    ( bottom of the screen.  To make sure type: )
  246. 1 EDIT<CR>
  247.    ( The screen should be blanked, and the text you just )
  248.    ( entered will be displayed at the top of the screen. )
  249.    ( The current line will be displayed at the bottom of the )
  250.    ( screen with a ^ pointing to the current editing cursor )
  251.    ( position.  The terminal's cursor will be below the ) 
  252.    ( line, and ready for an editing command. )
  253. DONE<CR>
  254. 1 Unmodified
  255.    ( Will again leave the editor and return to Forth )
  256.    ( Now we will save the system and leave Forth )
  257. SAVE-SYSTEM F.COM<CR>
  258.    ( That will save the current system as a file called )
  259.    ( F.COM on the currently logged drive. )
  260. BYE<CR>
  261.    ( This exits Forth and returns to CP/M.  Now if you use )
  262.    ( F.COM instead of F83.COM you will have your terminal )
  263.    ( routines installed at boot up time. )
  264. .paè     Note  that  the  above routines are designed for  an  ADM-3A 
  265. terminal,  and  will not work if your terminal is not an  ADM-3A.  
  266. You  will  have to consult your terminal manual for  the  correct 
  267. escape  sequences  required in order to position the  cursor  and 
  268. implement the other special functions required.   A better way to 
  269. do  the  above  is to recompile  the  entire  system,  with  your 
  270. terminal  routines  installed as the default instead of the  DUMB 
  271. terminal  routines  supplied  with  the  system.    In  order  to 
  272. accomplish this you should copy the screen you just entered  into 
  273. the UTILITY.BLK file and recompile the system as described above.  
  274. The  following  illustrates how to do this,  using the  multifile 
  275. utility words implemented in F83.
  276.  
  277. F83 UTILITY.BLK<CR>
  278.    ( files up F83 and opens UTILITY.BLK as the default file.  )
  279.    ( Make sure that UTILITY.BLK is on the currently logged )
  280.    ( drive )
  281.    ( Now find a blank or irelevant screen at the end of the )
  282.    ( editors set of screens, on top of which we are going to )
  283.    ( put the screen we just entered.  Suppose it is screen )
  284.    ( number 32.  You should now type: )
  285. FROM SAMPLE.BLK 1 32 COPY<CR>
  286.    ( This will copy screen 1 from SAMPLE.BLK to screen 32 of )
  287.    ( the current file.  Note that SAMPLE.BLK must also be on )
  288.    ( the currently logged drive. )
  289.    ( You can now recompile the high level portion of the )
  290.    ( by leaving Forth and typeing the following: )
  291. BYE<CR>   ( leave Forth )
  292. KERNEL EXTEND86.BLK<CR>
  293. START<CR>
  294.    ( Of course all of the necessary files should be present )
  295.    ( on the currently logged drive in order for this to work )
  296.  
  297.  
  298.      If  you  are new to Forth your best bet is to  purchase  the 
  299. book  STARTING  FORTH  by LEO BRODIE.  It costs  about  seventeen 
  300. dollars  and is available at most large book stores.  On page  84 
  301. you will find the commands for the line editor.  Another valuable 
  302. reference is the new book by MARTIN TRACY called FORTH TOOLS.  It 
  303. is  available from MicroMotion,  12077 Wilshire Blvd.  Suite 506, 
  304. West Los Angeles,  CA 90025.   The price for the book is  $20.00.  
  305. The F83 model follows both the book and the Forth 83 standard. 
  306.  
  307.      The Forth Interest Group ( FIG ) has chapters in many areas. 
  308. In  the  San  Francisco Bay Area,  meetings are held on  the  4th 
  309. Saturday of each month,  currently at Chabot College in  Hayward, 
  310. CA.  Call  the  FIG  hot  line if you wish to  double  check  the 
  311. location ph 962-8653 or the FIG Tree BBS (300 baud) at 538-3580.
  312.  
  313.  
  314. Henry Laxen                                  Mike Perry
  315. 1259 Cornell Avenue                          1125 Bancroft Way
  316. Berkeley, CA 94706                           Berkeley, CA 94702
  317. .paè
  318.              System Memory Map  
  319.      The  memory map will vary somewhat with CPU,  and  operating 
  320. system,  and  options.  For CP/M on the 8080 with 64K of  memory, 
  321. with four block buffers and all utilities,  it is as  follows:  ( 
  322. all addresses in hexadecimal)
  323.  
  324.      0100      Jump to cold start
  325.      0104      Jump to warm start
  326.      0108 ----
  327.  
  328.                Dictionary with all utilities loaded.
  329.  
  330.      5E75 ---- HERE
  331.  
  332.                Free space.
  333.  
  334.      D10E ---- SP0, TIB
  335.  
  336.                | Text Input Buffer
  337.                V
  338.                             ^
  339.                Return Stack |
  340.  
  341.      D1D6 ---- RP0, >BUFFERS
  342.  
  343.                Block Buffer Pointer Table
  344.  
  345.      D200 ---- FIRST
  346.  
  347.                Block Buffers
  348.  
  349.      E200 ---- LIMIT
  350.  
  351.  
  352. .PAè             Standard System Documentation Requirement
  353.  
  354. 1.  The  system  dictionary space is CPU  dependant  and  can  be 
  355. determined by typeing HERE U. <CR>
  356.  
  357. 2. The application dictionary space is also CPU dependant and  is 
  358. the  difference  between  the  top  of  the  dictionary  and  the 
  359. beginning of the parameter stack.  The location of the  parameter 
  360. stack  varies depending on the amount of memory available to  the 
  361. machine.   The application dictionary space can be determined  by 
  362. typing SP@ HERE - U. <CR>
  363.  
  364. 3. The data stack space is the same as the dictionary space.
  365.  
  366. 4.  The return stack space was arbitrarily set at 256 bytes.   It 
  367. can be altered by remeta-compiling the system.
  368.  
  369. 5.  No  mass  storage block ranges are reserved  by  the  system, 
  370. other than the contents of the files that are distributed.
  371.  
  372. 6. The user has available to him blocks 0 thru 65534.  Note  that 
  373. block  0  may  not be used for loading.  Block  number  65535  is 
  374. reserved to indicate the buffer is missing.
  375.  
  376. 7. Any ascii terminal should work with this system.  If the  user 
  377. has  a  cursor  addressable terminal, the editor  can  be  easily 
  378. modified to take advantage of the terminal's characteristics.
  379.  
  380. 8. System action taken upon error conditions:
  381.  
  382.      ' <name> ['] <name>  not found results in ? error message
  383.      
  384.      */ */MOD / /MOD MOD UM/MOD  all division by 0 errors  result      
  385.      in a 0 quotient
  386.  
  387.      : in the case of an error, a ? error message will be printed
  388.  
  389.      DO if a nesting error occurs, the system will crash. (if you 
  390.      are lucky)
  391.  
  392.      EXECUTE  if  addr is not a compilation address,  the  system 
  393.      will crash. see DO
  394.  
  395.      EXIT if the top of the return stack does not contain a valid 
  396.      return point, the system will crash.  see DO
  397.  
  398.      FORGET <name>  if <name> is not found, a ? error message  is 
  399.      printed.   If the compilation vocabulary is  forgotten,  the 
  400.      system will crash. see DO
  401.  
  402.      FORTH-83  if the error condition occurs,  that this is not a  
  403.      standard  system,  I don't want to hear about it and I  hope 
  404.      the system not only crashes, but burns.
  405.  
  406.      LOAD if u is zero, the system will crash.  see DOè