| IDE >> JCreator 2 |
|
This page shows you how to set up JCreator 2.x for assembling, linking, and debugging assembly language programs. We will do this by adding commands to its Tools menu. Last update: 09/13/2002 JCreator (by Xinox software, Inc) is a popular editor among Java programmers, and is already installed in many university computer labs. You can download the LE version (limited edition) for free, or you can buy the Pro version for a reasonable Academic price. Visit jcreator.com for details. Step 1: Build 16-bit MASMYou're going to add a command named Build 16-bit MASM to the Tools menu in JCreator.
Step 1A: Test your new commandOpen an ASM file from the Chapter 15 examples. The Colorstr.asm program would work well for this example. JCreator doesn't know about ASM files, of course, so you'll have to select "All files (*.*)" from the pull-down list in the Open dialog. Select Build 16-bit MASM from the Tools menu. Your program should assemble and list all files in the current directory beginning with "Colorstr". Step 2: Debug 16-bit MASMYou're going to add a command named Debug 16-bit MASM to the Tools menu in JCreator.
Click on OK to close the Options dialog. Step 2A: Test your new commandAssuming that you just ran Step1A to build the ColorStr program, we can now debug the same program. Select Debug 16-bit MASM from the Tools menu. The CodeView debugger should load. (For more information on using CodeView, see our CodeView tutorial on this Web site.) While running CodeView, you can exit anytime by selecting Exit from CodeView's File menu. Step 3: Build 32-bit MASMYou're going to add a command named Build 32-bit MASM to the Tools menu in JCreator. This step is identical to the Build 16-bit MASM command you created earlier. The only difference is that you need to insert the make32.bat filename in the Arguments entry:
The following screen snapshot shows the setup for the Build 32-bit MASM command:
Click on OK to close the Options dialog. Step 3A: Test the "Build 32-bit MASM" commandOpen one of the 32-bit programs from the book examples. For example, you can select ArryScan.asm from Chapter 6. Build the program and verify that your new command works. Step 4: Debug 32-bit MASMYou're going to add a command named Debug 32-bit MASM to the Tools menu in JCreator. Select Options from the Configure menu. Select Tools in the left-hand pane of the Options dialog. Click the New button and select Program. Using the browse button provided you, navigate to the EXE file for the debugger you plan to use. Depending on which which 32-bit debugger you plan to use, here are some common filenames to look for:
The following, for example, is the complete path on a sample computer to the Visual Studio.Net debugger:
Once you have found a suitable debugger, click OK. Select devenv under Tools in the left-hand pane. In the right-hand panel, notice that the Command entry contains the full path to the devenv.exe program:
Click the Apply button. Now we're going to rename the tool to a more user-friendly name. Select Tools in the left-hand pane. Double-click on devenv in the right-hand pane, and rename it to Debug 32-bit MASM. Click on OK to save your changes. Step 4a: Test the "Debug 32-bit MASM" commandAssuming that you successfully assembled and linked a 32-bit program during Step 3a, you can now open its EXE file using the debugger. Select Debug 32-bit MASM from the Tools menu. Your 32-bit debugger should load the program. Debugger commands vary widely, of course, so we have a separate area on this Web site that deals with debugger commands. You can find it from the book's home page. Step 5: Run MASMYou're going to add a command named Run MASM to the Tools menu in JCreator. Select Options from the Configure menu. Select Tools in the left-hand pane of the Options dialog. Click on New and select DOS Command. Enter Run MASM into the edit window and click on OK. Click on Apply. Select Run MASM under Tools in the left-hand pane. Enter the following arguments:
Click on OK to close the Options dialog. Test this new command by building a 16-bit or 32-bit assembly language program, and then selecting Run MASM from the Tools menu. Optional: Define an ASM Document TypeWe mentioned earlier that ASM files are not one of the standard(optional) file types recognized by JCreator. If you're using JCreator Pro, you can change that by adding ASM to the Options / Documents list. Regardless of which version of JCreator you're using, right-click on this link to download a syntax file named masm6.syn from our Web site. Save the file in JCreator's \Syntax directory. For example:
or:
With JCreator running, close any edit windows that might currently be open. Select one of the two blue boxes coming up next, depending on which version of JCreator you're using:
Modifying a Document TypeYou can customize the colors used for syntax highlighting from the Options dialog. In the left-hand pane click on the + sign next to ASM source file (under Documents) to expand its list. (If you're using JCreator LE, click on the + next to Default under the Editor heading.) Select Colors. Customize the colors in the right panel for all of the syntax elements. When you're finished, click on OK to close the Options dialog. Try it out: Select the File/Open command, and select ASM source file (or Default in JCreator LE) from the list of file types in the Open dialog. Note the colors used for syntax highlighting in the file. Final note: if you discover a keyword to be missing from the syntax highlighting, you can edit the syntax definition file. Select Options from the Configure menu. Select Syntax under ASM source file. Click the Open button. If you make any changes to the syntax file, you will not see the results until you run JCreator again. (As a work-around, you can un-check and re-check the Enable syntax highlighting option and click the Apply button. Then your changes will show up immediately.) You're finished configuring JCreator for assembly language. Enjoy! |