home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / FPC355_4.ZIP / TCOM.ZIP / TCOMHELP.DOC < prev    next >
Encoding:
Text File  |  1990-04-26  |  8.1 KB  |  192 lines

  1.  
  2. °EDMAIN             Help with the TCOM Compiler      Press ∙F10 to leave
  3.  
  4.   This hypertext help system provides online help for the TCOM compiler.
  5.  
  6.   ∙TCOM?      What is TCOM anyway?  ∙Why?       Why was TCOM written?
  7.  
  8.   ∙Make_TCOM  How do I build TCOM?  ∙Files?     What are the files for?
  9.  
  10.   ∙Usage      How do I use TCOM?    ∙Examples   TCOM example programs
  11.  
  12.   ∙Options    Command line options  ∙Registers  How does TCOM use regs?
  13.  
  14.   ∙Features   What can TCOM do?     ∙Notes      Notes on development
  15.  
  16.   ∙Limits     What can TCOM NOT do? ∙Describe   How does TCOM work?
  17.  
  18.  
  19.   NOTE: Move the cursor to a hilighted topic, and press F9 to examine
  20.         that topic. To back out of a topic back to the previous topic,
  21.         press F10. Press Shift F10 to leave help.
  22.  
  23. °Make_TCOM       Building the Target COMpiler (TCOM)
  24.  
  25.  
  26.   TCOM is supplied in both source and executable form. the TCOM.EXE
  27. provided, can compile any application. If you want to re-compile TCOM,
  28. it relies on the presence of FPC, so FPC must be installed before TCOM
  29. can be compiled.
  30.  
  31.   Install FPC if you have not already done so. Include the \FPC
  32. directory in your system PATH statment, and reboot your computer to
  33. make it take effect.
  34.  
  35.   Having installed FPC, change to the TCOM directory, and type:
  36.  
  37.         MAKETCOM <enter>
  38.  
  39.   Provided you have included \FPC in your system PATH, a TCOM.EXE file
  40. will be built. TCOM.EXE will include all of the library files specified
  41. in the loadfile TARGET.SEQ.
  42.  
  43.  
  44. °Usage          Using TCOM to compile an application
  45.  
  46.   Using TCOM is really very easy. It is normally invoked from the DOS
  47. command line as follows:
  48.  
  49.                 C:>TCOM sample <Enter>
  50.  
  51.   TCOM will open "sample.SEQ", and compile it into an executable file
  52. "sample.COM", and return to DOS.
  53.  
  54.   Additional command line options can be placed after the filename, to
  55. cause the compiler to perform additional tasks. For example:
  56.  
  57.                 C:>TCOM sample /OPT /SYM <Enter>
  58.  
  59.   This line will compile "sample" with optimization turned on, and will
  60. also generate a "sample.SYM" symbol file for use while debugging.
  61. Additional command line options are available, see the section ∙Options .
  62.  
  63.   Press ∙PgDn for information on modifying a program for TCOM.
  64.  
  65.                 Making a program compilable under TCOM
  66.  
  67.   Some relatively small changes have to be made to a program to get it to
  68. compile successfully with TCOM. One possible change, is that TCOM makes
  69. the last COLON definition in your program the entry point of the program.
  70. If the last definition in your program is not the entry point, then you
  71. will need to add a definition to the end of your program to execute the
  72. real entry point of your program.
  73.  
  74.   The name of the added definition is not important, TCOM will always
  75. start executing your program at the LAST COLON DEFINITION it encounters.
  76.  
  77.   Once you have compiled a program with TCOM, you will probably need to
  78. debug it. For information on debugging, see ∙Debugging
  79.  
  80.  
  81.  
  82.  
  83.  
  84.                                                 Press F10 to return
  85.  
  86. °Options           Command line Options available for TCOM
  87.  
  88.   The TCOM compiler defaults to the following options when a
  89. commandline is specified without options.
  90.  
  91.         /codeoff  = Disable the listing of generated assembly code.
  92.         /definit  = Include the default initialization. (see DEFINIT.SEQ)
  93.         /lstoff   = Don't generate a listing file.
  94.         /optoff   = Disable compile optimization.
  95.         /showoff  = Don't show symbols as they are compiled.
  96.         /srcoff   = Disable the listing of source lines.
  97.         /symoff   = Don't generate a symbol file.
  98.  
  99.   These options provide a reasonable compiled output for experimentation.
  100. Additional options allow more flexible control.
  101.  
  102.  
  103.  
  104.  
  105.                                         Press ∙PgDn for more Options
  106.  
  107.                     More Command line Options for TCOM
  108.  
  109.   These options provide additional control over the compiler.
  110.  
  111.         /code     = Enable the listing of generated assembly code.
  112.         /lst      = Generate a listing file with source, asm & symbol map.
  113.         /noinit   = Don't do automatic target initialization, user does it.
  114.         /opt      = Enable compiler CODE optimization.
  115.         /quiet    = Reduce visual output, use with I/O redirection.
  116.         /show     = Show symbols as they are compiled.
  117.         /src      = Enable  the listing of source lines.
  118.         /stay     = Stay in Forth after the compile finishes.
  119.         /sym      = Generate a symbol file for BXDEBUG.
  120.  
  121.   The option /NOINIT above requires aditional commands, and is described
  122. on the following screen. For options on debugging, see ∙Debugging . More
  123. options are available for setting various target parameters, see ∙TPARAMS
  124.  
  125.  
  126.                                         Press ∙PgDn for more info
  127.  
  128.                 Information on the /NOINIT option
  129.  
  130.   Some operations in a target application require initialization before
  131. they can be used. For example: If you want to spawn a DOS shell, then
  132. your target program must release some memory back to DOS before spawning
  133. the shell, or DOS won't have any memory to use for the shell. The TCOM
  134. compiler automatically initializes this and several other operations to
  135. prevent the user from having to do or know about this initialization.
  136. Normally this is fine, but there is about a 1k memory overhead imposed by
  137. the initialization that some programs will find excessive. To deal with
  138. this eventuality, TCOM provides an option "/NOINIT" to disable the
  139. automatic initialization. When this option is used, YOU MUST DO ANY
  140. NEEDED INITIALIZATION YOURSELF. Examine the file DEFINIT.SEQ to see what
  141. initialization is normally done, and include whatever lines are needed
  142. for your application in your source file.
  143.  
  144.   If you are not conscerned about the 1k overhead, then just let the
  145. compiler do the initialization for you.
  146.  
  147.   More information on /NOINIT -> ∙Def_Init        Press ∙PgDn for more
  148.  
  149. °TPARAMS          Command line Target Parameters
  150.  
  151.   Various parameters about the target program can be specified if desired
  152. to adjust the target image. The default parameters chosen will normally
  153. work well for DOS type programs, but programs compiled for ROM, will need
  154. to use these commands to adjust the compiler output.
  155.  
  156.   /code-start <adr> = Start compiling code at <adr>. Normally $0100.
  157.   /data-start <adr> = Start compiling data at <adr>. Normally $0000.
  158.   /code-limit <n1>  = Size limit between CODE and DATA.
  159.   /ram-start  <seg> = Segment where RAM will exist in the TARGET.
  160.   /ram-size   <n1>  = Amount of ram that will be available in the TARGET.
  161.  
  162.  
  163.   /RAM-START defaults to $FFFF, which signals the compiler that it is
  164. compiling a DOS or RAM resident program. Using the /RAM-START command
  165. to set a valid segment, will signal the compile to automatically compile
  166. the target code needed to move user strings and data from ROM to RAM at
  167. program runtime.
  168.                                                 Press F10 to return
  169.  
  170. °Debugging              Debugging a TCOM Program
  171.  
  172.   TCOM provides two ways to debug your programs, The first is BXDEBUG.
  173. BXDEBUG is a shareware assembly language debugger. TCOM can create
  174. symbol files for it, the "/SYM" command line option will do this. BXDEBUG
  175. allows all the usual breakpoint and trace capability. Its primary
  176. limitation is it will only handle 200 symbols. TCOM's programs often have
  177. more than this.
  178.  
  179.   TCOM also provides a limited but useful assembly debugging environment
  180. that can be appended to your program at compile time with the options
  181. /FORTH, /DIS, and /DEBUG. These options represent three levels and sizes
  182. of additions you can include with your program to add a Forth
  183. interpreter, a disassembler, and a debugger. Each option needs an
  184. automatically includes the previous option. The added code to your
  185. program will range from about 3k for the /FORTH option with optimized
  186. code (/OPT), up to 27k for the /DEBUG option without optimization. A
  187. corresponding increase in compile time will also result. While this is
  188. not the ultimate solution for program debug, it does provide a useful way
  189. to get your programs working.
  190.                                                 Press F10 to return
  191.  
  192.