home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / FPC355_3.ZIP / FPCDOC.ZIP / CHAPTER0.TXT < prev    next >
Encoding:
Text File  |  1989-10-29  |  21.7 KB  |  431 lines

  1. F-PC USER'S MANUAL
  2.  
  3.  
  4. F-PC Version 3.5, November 1989
  5.  
  6.  
  7.  
  8.  
  9. F-PC is a public domain Forth system optimized for IBM-PC/XT/AT type of
  10. computers under MS-DOS operating system.  It is supplied on a set of four
  11. diskettes with all the source code and documentation.  Files are all
  12. compressed in the .ARC format.  The diskettes are not copy-protected and
  13. the users are free to make backup copies and give copies to others.  The
  14. only exception is that Dr. Robert L. Smith reserved the copyright on his
  15. software floating point package contained in the files SFLOAT.SEQ,
  16. SFLOAT1.SEQ, SFLOAT2.SEQ, and SFLOAT3.SEQ.  This package is made
  17. available for unlimited personal, non-commercial use.  If you want to
  18. include the whole or part of this package in your product for sell at a
  19. profit, you should obtain a license from Robert Smith.
  20.  
  21. This Manual is also in the public domain and the copyright is forfeited.
  22. You are free to copy it and distribute it with the F-PC diskettes.
  23. However, the companying F-PC Technical Reference Manual is copyrighted by
  24. Dr. C. H. Ting.
  25.  
  26. As F-PC is produced on volunteer efforts and donated to the public
  27. domain, the authors and the F- PC Working Group declined to bear
  28. responsibility for any special, consequential or other damages on using
  29. F-PC system for any application, although every possible effort was made
  30. to ensure its integrity for correct operation.
  31.  
  32. Authentic copies of F-PC diskettes, F-PC Technical Reference Manual and
  33. this F-PC User's Manual can be obtained from Offete Enterprises, Inc.
  34. The diskette set is $25.00, the Technical Reference Manual is $30.00, and
  35. this Manual is $20.00 plus handling and sales tax.
  36.  
  37. There are two versions of F-PC in circulation.  Version 2.25 was released
  38. in November 1988.  All files were in the .ARC format.  Version 3.5 is
  39. released in November 1989 and files are in the .ZIP format.
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Offete Enterprises, Inc.
  48. 1306 South B Street
  49. San Mateo, CA 94402
  50. Tel. (415) 574-8250
  51.  
  52. PREFACE TO THE THIRD EDITION
  53.  
  54.  
  55.  
  56. F-PC has been circulated in the Forth community for more than a year now.
  57. The user response is very positive as people need good tools to do
  58. productive work in the MS-DOS and IBM- PC/XT/AT environments.  Text files
  59. are used almost universally.  F-PC fills these needs very nicely, with
  60. its rather powerful SED text editor, the capability to access all 640K
  61. bytes of memory, and the smooth interface to MS-DOS and the hardware
  62. underneath.  We have also seem very large applications built upon F-PC,
  63. free from the 64K byte limitation.
  64.  
  65. Although many people had made substantial contributions to F-PC, it is
  66. still a product of a single person, Tom Zimmer.  Tom is very prolific in
  67. producing code.  The most interesting thing about him is that he has a
  68. very fluid and open mind about programming, and very receptive to other
  69. peoples ideas and techniques.  People ask him questions on the phone,
  70. complaining about some inadequacies in F-PC, and sending him programs and
  71. applications.  He would say: "Hmmm. That's very interesting.  Let me
  72. think about it."  The next day he would have some new features added to
  73. F-PC, and the version number was automatically incremented.
  74.  
  75. This is the mindset which allows F-PC to grow and to include many
  76. utilities useful for Forth programmer in their daily programming
  77. activity.  An old Chinese proverb says:
  78.  
  79. The ocean is big because it does not refuse water from small streams;
  80. Mount Tai is tall because it does not reject dirt and small pebbles.
  81.  
  82. F-PC thus becomes a great reservoir of tools and utilities that each of
  83. us can use to build applications and to further our understanding of
  84. Forth.
  85.  
  86. On the other had, it is very difficult to document a changing system and
  87. make the system useful for people near and far.  It was a Herculean
  88. struggle to hold down F-PC's version auto-incrementer. After I finished
  89. the User's Manual and the Technical Reference Manual for Version 2.21, I
  90. was confronted by Version 2.25.  Under great pressure, I agreed to update
  91. the documents to 2.25, but under one condition:  I would keep the 2.21
  92. documents in ready reserve.  In case 2.25 got changed again, I would go
  93. back and supply 2.21 documentation only.  For this reason, I had used
  94. F-PC 2.21 on all my computers, even after I started distribution F-PC
  95. 2.25 and its documentation to other people.
  96.  
  97. In the late spring, 1989, Tom was ready to revise F-PC again, although
  98. our understanding was that no update would be considered before the
  99. August.  However, there were a few serious bugs which needed to be fixed,
  100. and many new features Tom just could not wait to install.  In the end, we
  101. reached the compromise that F-PC was upgraded to Version 2.2501, with 01
  102. in lower case, with only the bug-fixes.  As for the new features, Tom
  103. could do whatever he saw fit and distributed to whoever wanted it, but
  104. not under the name F-PC.  With that, Tom marched right off, changed the
  105. name to F-TZ, and turned on the version auto-incrementer.
  106.  
  107. There were many significant improvements in F-TZ, like the browser which
  108. allows the user to browse source and help files inside the editor, the
  109. hypetext on-line documentation system, the new system installation
  110. procedure, better help files on the kernel, improved mouse support, and
  111. other minor enhancements.  In September, 1989, the F-PC Working Group was
  112. reconvened in the Silicon Valley FIG Chapter to consider upgrading F-PC.
  113. The Group accepted F-TZ as the new version of F-PC, and I got the job to
  114. upgrade the documentation.
  115.  
  116. October 1989 C. H. Ting
  117.  
  118. PREFACE TO THE FIRST EDITION:
  119.  
  120.  A TRADITION OF PUBLIC DOMAIN FORTH
  121.  
  122.  
  123.  
  124. Forth was invented by Charles Moore in the 1960's as he developed
  125. specialized tools for various applications.  It was formalized into a
  126. programming language for telescope automation while Mr. Moore was with
  127. the National Radio Astronomy Observatory.  As this work was supported by
  128. public funds, Forth was born as a public domain software package which
  129. followed telescopes to many different countries.  In 1972 Mr. Moore left
  130. NRAO to form FORTH, Inc. in order to market Forth systems and services.
  131. Implementations developed in FORTH, Inc. were proprietary and their usage
  132. required license from FORTH, Inc.  However, a copy of Forth for PDP-11
  133. was released to DECUS, the DEC Users Group, which became the only readily
  134. available public domain Forth for many years.
  135.  
  136. Forth Interest Group was organized in 1978 to encourage the use of Forth
  137. on small personal computers, which gradually became available for
  138. individual users.  One major effort by Forth Interest Group was the
  139. formation of Forth Implementation Team lead by Bill Ragsdale to build
  140. figForth and put it in the public domain for general distribution.
  141. Because figForth was implemented on many microprocessors based on a
  142. single model and released with complete source listings, it became the de
  143. facto standard of Forth on personal computers, eclipsing polyForth which
  144. was by then the main product from FORTH, Inc.
  145.  
  146. The other major objective of Forth Interest Group was to establish a
  147. standard definition of Forth as a programming language.  Forth Standards
  148. Team was organized in 1978.  It took the Forth-77 Standard developed by
  149. Forth users in Europe and produced Forth-78 Standard.  It was very
  150. unsatisfactory and was almost immediately reworked into the Forth-79
  151. Standard which was accepted by Forth Interest Group for promotion.
  152. However, Forth Interest Group also decided that it would not publish
  153. implementations and only encouraged Forth vendors to provided
  154. implementations and support.  The only major public domain Forth
  155. supporting Forth-79 Standard was MVP-Forth written by Glen Haydon and
  156. distributed by Mountain View Press.
  157.  
  158. Forth Standard Team continued the refinement of Forth language and
  159. published the Forth-83 Standard in 1983.  Again, Forth Interest Group
  160. supported and promoted it, but did not provided any implementation.
  161. Henry Laxen and Mike Perry felt that the Standard could not spread
  162. without a faithful and useful implementation.  They implemented a
  163. comprehensive model on 8080, 8086, and 68000 processors with fairly
  164. uniform and transparent interfaces to the CP/M and MS-DOS operating
  165. systems.  This public domain F83 model found wide acceptance, especially
  166. among IBM PC users after it was listed in the PC-SIG catalog.
  167.  
  168. From 1983 to 1988, personal computers have made significant progress in
  169. memory size and in disk space.  The traditional minimalist's approach in
  170. the Forth operating system seems to be inadequate to stay abreast with
  171. the tools and facilities embedded in the current personal computers. It
  172. is necessary that Forth must communicate with the operating system in
  173. standard file formats, and it has to address memory outside of the 64K
  174. byte addressing space.  These capabilities were included in many 68000
  175. Forth implementations, but not in the PC world due to the segmented
  176. architecture and the handicapped operating system.  F-PC is a collective
  177. effort to provide PC users a highly optimized version of public domain
  178. Forth addressing these problems.  It allows the user a well integrated
  179. environment to develop and maintain large applications utilizing the
  180. memory and storage space generally available in a mid-range IBM PC/XT/AT
  181. and its clones.  It is released to public domain with complete source,
  182. following the spirit of figForth and F83, so that users will have the
  183. freedom to tailor it to their specific applications and to build
  184. commercial products from it.
  185.  
  186. F-PC is a greatly enhanced version of Forth derived from the F83 model
  187. for the IBM-PC, XT, or AT developed by Tom Zimmer at Maxtor Corp.  A
  188. major stepping stone between F-PC and F83 was the F83Y system produced by
  189. Wil Baden, who adopted J. D. Hooper's separated heads and many other
  190. features like interpreted conditionals, full featured decompiler, etc.
  191. Many other people also contributed to it, including Robert L. Smith,
  192. Charles Curley, and Jerry Modrow, but the major work was done by Tom
  193. Zimmer.
  194.  
  195. In order to release this system for public usage, it is necessary to
  196. provide better and more complete documentation on the system so that a
  197. Forth programmer can pick it up and use the system productively on his
  198. own, without having to have access to Tom Zimmer for support and
  199. consultation.  A F-PC Working Group was organized to serve two very
  200. specific purposes: to do beta testing on the system to flush out as many
  201. bugs as possible, and to provide user and system documentation so that
  202. both application and system Forth programmers can use the system in
  203. isolated (in the Forth sense) geographic locations.
  204.  
  205. The F-PC Working Group was very loosely organized in the Silicon Valley
  206. FIG (SVFIG) Chapter, during the chapter meeting at April 23, 1988.  Many
  207. Chapter members participated and contributed to this effort.  The Chapter
  208. also permitted the Working Group to use the morning FORML sessions in May
  209. and June to discuss and work on F-PC.  Dr. C. H. Ting served as the focus
  210. of this Group to coordinate the efforts in documentation.  Bug reports,
  211. suggestions, and recommendation were collected and forwarded to Tom
  212. Zimmer for consideration.
  213.  
  214. This Manual is part of the documentation to be made available with the
  215. F-PC system.  It provides information on how to install F-PC, and the
  216. most useful utilities for normal programming activity. It also assumes
  217. that the user is familiar with Forth and DOS, and does not try to include
  218. introduction materials.  As F-PC retains the look-and-feel of F83, prior
  219. knowledge on F83 will be extremely helpful.  The background information
  220. can be obtained from the following sources:
  221.  
  222. Starting Forth, Leo Brodie, Prentice Hall.
  223. Programmer's Guide to the IBM-PC, Peter Norton, MicroSoft Press.
  224. Inside F83, C. H. Ting, Offete Enterprises.
  225.  
  226. We hope that you will find F-PC valuable as you try to make the best use
  227. of the resources in your PC or compatible computer.  We would also like
  228. to know if you succeeded in using it to develop real and interesting
  229. applications.  The User Contributions section of F-PC will always be open
  230. to new submissions.  We hope that F-PC will provide a common format for
  231. users to exchange code, ideas, and applications, the same way F83 has
  232. been over the last five years.
  233.  
  234. F-PC has evolved over the last six months.  Tom Zimmer made substantial
  235. modifications and enhancements to it.  However, due to the pressure
  236. exerted on him by many users and members in this Working Group, Tom
  237. reluctantly agreed to freeze F-PC at the current Version 2.25.  It will
  238. not be modified until late next year so that users can start using it to
  239. do applications.  Both the User's Manual and the Technical Reference
  240. Manual were updated to this version.  Having accomplished its mission,
  241. the F-PC Working Group ceases its existence.  However, technical
  242. discussions on F- PC and a very extensive tutorial lead by Jack Brown
  243. have appeared on the Forth Roundtable in the GEnie Network.  F-PC users
  244. are encouraged to join the Forth Roundtable for information, assistance,
  245. and possibly bug fixes.
  246.  
  247. Dr. C. H. Ting
  248. Documentation Coordinator
  249. F-PC Working Group
  250. December, 1988
  251. San Mateo, California
  252.  
  253. F-PC USERS MANUAL
  254.  
  255.  
  256.  
  257.  
  258. CONTENTS
  259.  
  260.  
  261. F-PC User's Manual                                                  i
  262.  
  263. Preface to the Third Edition                                        ii
  264.  
  265. Preface to the First Edition: A Tradition of Public Domain Forth    iii
  266.  
  267. 1.   Introduction to F-PC                                           1
  268.         1.   How did we get here?                                   1
  269.         2.   F-PC, what is it all about                             3
  270.         3.   Features in F-PC 2.25                                  4
  271.         4.   New features in F-PC 3.5                               5
  272.  
  273. 2.   Install F-PC                                                   6
  274.         1.   The ZIP files                                          6
  275.         2.   Install F-PC using INSTALL.EXE                         7
  276.         3.   Install F-PC without using INSTALL.EXE                 8
  277.         4.   Configure F-PC                                         9
  278.         5.   Install F-PC on a dual floppy system                   10
  279.  
  280. 3.   Hypertext Browser                                              12
  281.         1.   Launch the hypertext browser                           12
  282.         2.   Navigate F-PC with the browser                         13
  283.         3.   A sample session                                       14
  284.         4.   A short tutorial                                       15
  285.  
  286. 4.   Programming Tools                                              18
  287.         1.   DUMP                                                   18
  288.         2.   The debugger                                           18
  289.         3.   VALUES: Constants as variables                         20
  290.         4.   Help words                                             20
  291.         5.   Date and time                                          22
  292.         6.   Comments                                               23
  293.         7.   Screen control words in F-PC                           23
  294.         8.   Compilation control words                              25
  295.         9.   Printing source files in F-PC                          26
  296.         10. Global search                                           26
  297.         11. ALIAS                                                   27
  298.         12. Browsing a large file                                   27
  299.         13. The NEWZ editor                                         27
  300.         14. The SZ editor                                           28
  301.  
  302. 5.   SED, the Editor                                                30
  303.         1.   Invoking SED editor                                    31
  304.         2.   Using SED                                              32
  305.         3.   Menu and mouse control                                 33
  306.         4.   Function keys                                          34
  307.         5.   Selecting another file to edit                         36
  308.         6.   Search and replace                                     37
  309.         7.   Cut, copy and paste                                    37
  310.         8.   Line and word commands                                 38
  311.         9.   Margin control                                         39
  312.         10. Case conversion                                         39
  313.         11. Line drawing                                            40
  314.         12. Paragraph sorting                                       40
  315.         13. Keystroke macros                                        40
  316.         14. Print a file                                            41
  317.         15. Other help                                              42
  318.  
  319. 6.   Sequential Files                                               43
  320.         1.   Sequential files in F-PC                               43
  321.         2.   Handles                                                43
  322.         3.   Sequential file word set                               45
  323.         4.   Conversion between sequential file and block files     49
  324.         5.   Programming style and sequential files                 50
  325.  
  326. 7.   DOS Interface                                                  51
  327.         1.   System interrupts and BIOS calls                       51
  328.         2.   DOS service calls                                      52
  329.         3.   The DOS shell                                          53
  330.         4.   BATCH commands                                         54
  331.         5.   DOS memory map of F-PC                                 54
  332.         6.   Long memory word set                                   58
  333.         7.   Memory allocation                                      59
  334.  
  335. 8.   PASM, the F-PC Assembler                                       60
  336.         1.   Prefix or postfix?                                     60
  337.         2.   PASM glossary                                          61
  338.         3.   Syntax comparison                                      63
  339.         4.   Usage of 8086 machine registers in F-PC                63
  340.         5.   Addressing modes                                       64
  341.         6.   Assembly macros in PASM                                66
  342.         7.   Local label                                            66
  343.         8.   Inline code                                            67
  344.         9.   Assembler style                                        69
  345.         10. Debugging code words                                    70
  346.  
  347. IX.   Advanced Utilities                                            71
  348.         1.   Rebuilding the system                                  71
  349.         2.   Turnkey systems                                        72
  350.         3.   Macros in F-PC and SED                                 72
  351.         4.   F-PC preferences                                       72
  352.         5.   Task chaining                                          74
  353.         6.   Control structure enhancements                         75
  354.         7.   Headless words                                         77
  355.         8.   Save and restore                                       78
  356.         9.   Line editor                                            79
  357.  
  358. 10.   User Contributions                                            80
  359.         1.   From Tom Zimmer                                        80
  360.         2.   From Charles Curley                                    84
  361.         3.   From Bob Smith                                         85
  362.                 HFLOAT/SFLOAT glossary                              87
  363.  
  364. Epilogue                                                            91
  365.         How to Hang F-PC without a Long Rope                        91
  366.         The kitchen sink                                            92
  367.         An invitation                                               92
  368.         Forth Interest Group local chapters                         93
  369.         Forth on-line resources                                     96
  370.  
  371. Appendix A.     Glossary of the Forth Vocabulary                    A-1
  372.         A1.   Introduction                                          A-1
  373.         A2.   F-PC word glossary by category                        A-2
  374.         A3.   F-PC alphabetic glossary                              A-12
  375.  
  376. Appendix B.     Samples and Tutorial Files                          B-1
  377.         B1.   Memory allocation                                     B-1
  378.         B2.   User boot process                                     B-2
  379.         B3.   F-PC keystroke macros                                 B-3
  380.         B4.   A sample menu file                                    B-6
  381.         B5.   My startup message                                    B-7
  382.         B6.   Subscreen scroll                                      B-8
  383.         B7.   Usage of values                                       B-8
  384.         B8.   Popup window                                          B-9
  385.  
  386. Appendix C.   Files in F-PC                                         C-1
  387.         C1.   Files on the distribution disks                       C-1
  388.         C2.   Zipped files on Disk 1                                C-2
  389.         C3.   Zipped files on Disk 2                                C-3
  390.         C4.   Zipped files on Disk 3                                C-5
  391.  
  392. Appendix D.     Index                                               D-1
  393.  
  394. Figures
  395.         Figure  6.1.    The file handle                             44
  396.         Figure  7.1.    The memory segments in F-PC                 56
  397.         Figure  7.2.    Data structure in a colon definition        57
  398.         Figure  8.1.    Comparison of assembly syntax               62
  399.         Figure  8.2.    Examples of local labels                    68
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407. F-PC USER'S MANUAL
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415. THIRD EDITION FOR VERSION 3.5
  416.  
  417.  
  418.  
  419. NOVEMBER 1989
  420.  
  421.  
  422.  
  423.  
  424.  
  425. Offete Enterprises, Inc.
  426.  
  427. 1306 South B Street
  428. San Mateo,  CA  94402
  429. Tel. (415) 574-8250
  430.  
  431.