After you have installed the book's CD-ROM (presumably in the C:\Masm615 directory), change to the \Examples\ch03 subdirectory and look for the file AddSubR.asm. Assemble and link this program. If you don't know how to do this, read the Getting Started Web page.
After your program has been assembled and linked, you're ready to load its EXE file using CodeView. Open an MS-DOS command window, and type the following, pressing Enter after each line:
Here's what CodeView displays the first time you load the program. The highlight bar in the source window is automatically placed on your program's first executable instruction:
Your window setup might not look exactly like this. To modify the window setup, click here.
Begin Tracing the Program
Press the F10 function key to begin tracing the program. Watch the highlight bar in the source window move downard, each time showing the next instruction about to be executed. Watch the registers change values. In the following example, we are about to execute line 19:
Trace the Program
Keep pressing F10 until you have executed the last instruction in the program ( INT 21h, line 26). You will see a series of unfamiliar instructions in the source window after this. If you press F10 one more time, a message box says that the program has ended. This is not an error message. You can now click on OK to restart the program, or press the Esc key to close the message box:
Restart the Program
Any any time while debugging, you can restart a program by selecting Restart from the Run menu. Try it now, and again trace the program using the F10 key. When you are finished debugging, select Exit from the File menu.
Remove the Locals Window
Click the mouse in the upper (locals) window to select it. Notice that a small black square appears in the upper left corner. Wait, my mouse doesn't work right!
Click on the square to remove the window:
Resize the Source Window
Select the source window with the mouse, and drag its top border with the mouse so the source window is positioned at the top of the CodeView window. Then, drag the lower-right corner of the source window until it uses about 3/4 of the total available space. Leave about 1/4 of the space on the right side open:
Insert the Registers Window
From the Windows menu, select Register. This will cause the Reg window to appear. Drag this window just to the right of the source window.