| IDE >> TextPad 4.5 |
|
Updated: 12/22/2003 TextPad is a registered trademark of Helios Software Solutions. Their web site is www.textpad.com. Helios has permitted us to distribute an unregistered evaluation copy of TextPad 4. I personally use it as my editor of choice for assembly language because it can easily customized. I particularly like its built-in syntax highlighting feature. In this short tutorial, we will show you how to add commands to the Tools menu in TextPad, so you can easily assemble, link, and debug your assembly language programs. First: Run the TextPad4.exe program located in the \TextPad directory of the CDROM in your book. This program will install the TextPad 4 text editor. Click here to begin adding the Tool commands. Optional: Create a MASM document class in TextPad. This will enable you to customize colors, add syntax highlighting, and configure other options. Optional: Test your configuration. If you're writing 32-bit programs, open the AddSub.asm program from Chapter 3. If you're writing 16-bit programs, open the AddSubR.asm program from the same directory. Select the appropriate Build command from the Tools menu.
Next, modfy the program by intentionally inserting errors. Save the program and build it again. Note how the error messages are formatted in the output window, showing each line number that contains an error. Correct your error and build the program again. Notice that when you execute the Run MASM tool, you have to close the MS-DOS window after the program has finished. If you want to make the window close immediately, click here. More Information?If you need more information, TextPad has extensive online help that shows how to edit the Tools menu. If you're making these modifications for multiple users (as in a laboratory), you can use RegEdit to save the registry subtree to a REG file. Look for the following entry:
Advanced Users OnlyIf you have experience with the MS-Windows system registry, you can download and import one of the following files into your system registry. They will update your TextPad settings automatically, so you will not have to go through the manual steps shown elsewhere in this tutorial:
Important: The registry file time must match your operating system. You cannot use these files to update a Windows 98 registry, for example. Warning: Back up your system registry before making any changes!
Adding the Tool CommandsYou will be adding the following commands to the Tools menu in TextPad:
The order and spelling of the commands is unimportant. (It's easy to rearrange and rename existing commands.) Build 16-bit MASMThis command will be used to assemble and link 16-bit Real-mode programs. Do the following steps, in order:
Click on Apply to save your changes. Debug 16-bit MASMThis command will run the Microsoft CodeView debugger so you can debug 16-bit Real-mode programs. Do the following steps, in order:
Click on Apply to save your changes. Build 32-bit MASMThis command will be used to assemble and link 32-bit Protected mode programs. Do the following steps, in order:
Click on Apply to save your changes. (See our note about the Capture output option under the Build 16-bit MASM command.) Debug 32-bit MASMThis command will let you debug 32-bit Protected mode applications with a debugger of your choice. Click here to read more information about debugging choices.
After selecting the debugger filename, you may want to rename the command to something more user-friendly such as Debug 32-bit MASM. To do this, click once on the name, wait for a second. Retype the command's name and press the Enter key. Click on Apply to save your changes. Run MASMThis command will run the executable program identified by the file in the active edit window. Do the following steps, in order:
Click on OK to close the dialog and save your changes. You're done!
Improving the Run MASM CommandThere is a way to close the MS-DOS window immediately when using the Run MASM command. What you can do is use a batch file named runASM.bat, which you can download by right-clicking on this link and saving the file to your C:\Masm615 directory. Here are the setup steps:
Click on OK to save your changes.
Microsoft Visual Studio 6.0 DebuggerThe debugger's filename is msdev.exe. Find it and click on Open. Enter the following parameters: Click on Apply to save your changes. Continue to the RUN MASM command.
Microsoft Visual Studio.Net DebuggerThe debugger's filename is devenv.exe, usually located in the <SystemDrive>\Program Files\Microsoft Visual Studio .NET\Common7\IDE directory. Find it and click on Open. Enter the following parameters:
Click on Apply to save your changes. Continue to the RUN MASM command.
Microsoft Windows DebuggerThe debugger's filename is windbg.exe. Find it and click on Open. Enter the following parameters:
(-QY auto-saves the debugger's workspace file. -g skips over the MS-Windows startup code that launches your program. -G skips the MS-Windows cleanup code that executes after your program has ended.) For more information about debugging options, press F1 in WinDbg and look for the topic command-line options under Reference.) Click on Apply to save your changes. Continue to the RUN MASM command.
|