home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / editor / vp_demo.zip / VCSD.ZIP / COMPILE.DEM < prev    next >
Text File  |  1991-08-29  |  8KB  |  194 lines

  1.  
  2.         DEMONSTRATING THE VEDIT COMPILER SUPPORT
  3.         ----------------------------------------
  4.  
  5. You can start up the Compiler Support from DOS with the command:
  6.  
  7.     COMPILE ADDER.C
  8.  
  9. The Compiler Support starts up with a large menu on the right half of
  10. the screen.  Displayed near the top are the current Compiler, Linker,
  11. Debugger and Make commands.  The initial commands are set by the
  12. editable COMPILE.CNF file.
  13.  
  14. NOTES:    You can override the commands in COMPILE.CNF by creating the
  15.     file COMPILE.VCO in each local directory you use for
  16.     programming.  This file consists of the four lines - the
  17.     desired Compiler, Linker, Debugger and Make commands. This way
  18.     the correct Compiler/ Assembler is always ready to run. 
  19.     COMPILE.VCO files also let you set the Compiler options needed
  20.     for each of your programs. For example, one program may need
  21.     to be compiled with the "medium model" option while another
  22.     needs the "large model" option.  The Compiler Support will
  23.     adjust automatically.
  24.  
  25.     The prompt for whether you have a color display can be turned
  26.     off by editing COMPILE.CNF and changing "COLORDISPLAY=" from
  27.     a value of "?" to "Y" or "N".
  28.  
  29. Also displayed is the name of the "Current File", e.g. "ADDER.C".  
  30. This is also known as the "project" file and is the name of the file 
  31. to be compiler, linked and debugged.  The "-proj.ext" and "-proj" you 
  32. see in the Compiler, Linker and Debugger commands are place holders 
  33. for the current filename, with and without extension.
  34.  
  35.  
  36. Compiling ADDER
  37. ---------------
  38.  
  39. Assuming the Current File is ADDER.C, you can compile it by selecting 
  40. "C" from the main menu.  Your C compiler should run and report errors.  
  41. The Compiler Support should automatically load ADDER.C and position 
  42. the cursor on the first line containing an error.  The reported error 
  43. will also be displayed on the screen.  Correct the first error by 
  44. changing "num0" to "num1".  Press <ESC> for the "Error menu":
  45.  
  46. (N)ext  (P)revious  (F)irst  (B)rowse  (R)ecompile  (E)xit to Menu
  47.  
  48. Press "N" to advance to the next error.  ("Browse" lets you see all
  49. errors and select a desired error.)  Correct the error as described in
  50. the comment.  Press <ESC> and "N" again.  "No more errors" is
  51. displayed.  Press "R" to recompile.  The compilation should now be
  52. successful.  If indicated, press <ESC> to return to the main menu.
  53.  
  54.  
  55. Linking ADDER
  56. -------------
  57.  
  58. The program ADDER is now ready for linking.  Select "L" from the main
  59. menu.
  60.  
  61. The linker's output is displayed on the screen for you; press <ESC> to
  62. return to the main menu.
  63.  
  64. NOTE:    The Microsoft and Borland C Compilers also let you compile and
  65.     link in one step, but we have purposely broken it into
  66.     distinct compile and link steps.  One advantage is that the
  67.     Microsoft "/codeview" option is only available with the LINK
  68.     command.)
  69.  
  70.  
  71. Running / Debugging ADDER
  72. -------------------------
  73.  
  74. You can now run ADDER by selecting "G" from the main menu and at the
  75. prompt typing "ADDER".
  76.  
  77. In practice, you can run your debugger by selecting "D" from the main
  78. menu.
  79.  
  80.  
  81. Assembling EGA43
  82. ----------------
  83.  
  84. Change the current Compiler by selecting "S" from the main menu.  At
  85. the filename prompt simply press <Enter> for Point & Shoot file
  86. selection.  Select either "MASM" or "TASM".
  87.  
  88. NOTES:    When you select a new compiler, the Compiler Support loads the
  89.     associated ".VCS" file, e.g. "MASM.VCS" or "TASM.VCS".  Each
  90.     supported compiler has an associated ".VCS" file.  VEDIT
  91.     supports numerous other compilers.  Users can also create
  92.     their own ".VCS" files for custom compilers.
  93.  
  94.     The Compiler Support also loads the associated ".VCO" file,
  95.     e.g. "MASM.VCO" or "TASM.VCO".  The ".VCO" file contains the
  96.     new Compiler command you see displayed in the menu.  It can
  97.     also set new Linker, Debugger and Make commands.  In this
  98.     demo, it only sets the Compiler and Linker commands.
  99.  
  100. To assemble EGA43.ASM select "P" from the main menu.  At the filename
  101. prompt simply press <Enter>.  Select EGA43.ASM.
  102.  
  103. To assemble EGA43.ASM select "C" from the main menu.  EGA43.ASM also
  104. contains several obvious syntactic errors which need correction.
  105. Using the same procedure as with ADDER.C, correct the errors and
  106. re-assemble the program until no further errors are reported.
  107.  
  108.  
  109. Linking EGA43
  110. -------------
  111.  
  112. When you selected a new compiler (assembler) above, it changed both
  113. the Compiler and Linker commands.  The Linker command should now be
  114. set to "LINK /codeview -proj.obj;" or "TLINK -proj.obj" for the
  115. Microsoft or Borland linkers, respectively.
  116.  
  117. If you want to experiment with changing the Linker command, follow
  118. these steps:
  119.  
  120.     Select "O" from the main menu.  Select "L" from the "Change
  121.     Options" sub-menu to change the Link command.  Select "E" to edit
  122.     the command.  Edit the command as needed.  Press <Esc>.  Select
  123.     "X" twice to return to the main menu.
  124.  
  125. Select "L" from the main menu to run the linker.
  126.  
  127. Running EGA43
  128. -------------
  129.  
  130. You can now run EGA43 by selecting "G" from the main menu and at the
  131. prompt entering "EGA43".
  132.  
  133. You may want to restore the screen back to 25 lines by selecting "G"
  134. from the main menu and at the prompt entering "MODE CO80".
  135.  
  136.  
  137. Running Make
  138. ------------
  139.  
  140. This discussion assumes you are familiar with Make programs and
  141. "makefiles".
  142.  
  143. The Microsoft NMAKE and Borland MAKE programs are supported.  Using a
  144. "makefile" simplifies not only general program development, but also
  145. use of the Compiler Support.  The supplied makefile "MAKEFILE" will
  146. compile/assemble and link both ADDER.C and EGA43.ASM.  The Compiler
  147. Support automatically handles any errors reported by different
  148. compilers/assemblers used during the Make process.
  149.  
  150. The displayed Make command is "NMAKE /n" for Microsoft and "MAKE -n"
  151. for Borland.  The default makefile for each is "MAKEFILE".
  152.  
  153. To try the Make process first delete the files ADDER.OBJ, ADDER.EXE,
  154. EGA43.OBJ and EGA43.COM created by compiling and linking above.  You
  155. may want to reintroduce some errors in ADDER.C and EGA43.ASM.
  156.  
  157. Start the Make process by selecting "M" from the main menu.  The
  158. Compiler Support will display any errors reported by the compiler or
  159. assembler as before.  After correcting an error and pressing <ESC>, a
  160. different "Error menu" is displayed:
  161.  
  162. (N)ext (P)rev (F)irst (B)rowse (M)ake (R)etry (S)kip (E)xit to Menu
  163.  
  164. Press "R" to retry the current compilation.  "(M)ake" restarts the
  165. entire Make process.  "(S)kip" skips the current compilation and
  166. continues with the rest of the Make process.
  167.  
  168. When running Make, it is irrelevant what the current Compiler and
  169. Linker commands displayed in the Compiler Support's menu are.  The
  170. Make process is completely controlled by the makefile.  The Compiler
  171. Support automatically loads the appropriate ".VCS" files to handle any
  172. errors reported by a compiler or assembler.
  173.  
  174.  
  175. In practice, its simple
  176. -----------------------
  177.  
  178. In practice, you would set up COMPILE.VCO and "makefile" files for 
  179. each of your major programs.  It would then no longer be necessary to 
  180. switch compilers and change Compiler and Link commands from within the 
  181. Compiler Support.  You would simply start up the Compiler Support in 
  182. the program's directory and the Compile/Link commands would adjust 
  183. automatically.
  184.  
  185. The Compiler Support is normally used in conjunction with our V-SWAP 
  186. program.  When V-SWAP is loaded, you can start up the Compiler Support 
  187. at any time from within VEDIT by pressing <ALT-I>.  The current file 
  188. you are editing becomes ready for compilation.  V-SWAP will completely 
  189. swap VEDIT out of memory in order to run the most memory demanding 
  190. compilers and debuggers.
  191.  
  192. We hope that you have enjoyed the Compiler Support portion of the
  193. VEDIT PLUS demo/tutorial.
  194.