Hardware Reference
In-Depth Information
programmer to quickly locate logical errors in programs. The debugger can
display source and object code simultaneously (indicating the line which is
about to be executed), dynamically watch values (local or global), and switch
screens to display program output. Use of the debugger is, to a large extent,
intuitive and it greatly outperforms the DEBUG package supplied with DOS.
A full description of the facilities and use of CodeView (or an equivalent
debugger) is beyond the scope of this topic. Familiarity with the use of a
debugger is, however, strongly recommended to all potential assembly lan-
guage programmers as it can be instrumental in quickly and effectively dealing
with the vast majority of bugs and defects in assembly language programs.
A MASM walkthrough
As an example of using assembly language development tools from the CLI
the simple printer test routine that we met earlier in this chapter (see page 171)
and also in Chapter 3 (see page 148) is edited, assembled, linked, and tested
using the following sequence of commands and screen output. Later in this
chapter we provide an example of using a modern 32-bit Integrated Develop-
ment Environment (IDE) which automates the software development process
(see page 183).
Firstly, the source code file is entered using the Microsoft Editor:
C>m ptest.asm <ENTER>
When the editor is left, the source file ptest.asm is written to the hard disk. The
macro assembler is then invoked:
C>masm ptest <ENTER>
The following screen output is generated by the macro assembler:
Microsoft (R) Macro Assembler Version 5.10
Copyright (C) Microsoft Corp 1981, 1988. All rights reserved.
Object filename [ptest.OBJ]: <ENTER>
Source listing [NUL.LST]: <ENTER>
Cross-reference [NUL.CRF]: <ENTER>
50144 + 394061 Bytes symbol space free
0 Warning Errors
0 Severe Errors
The Linker is now used to produce an executable program:
C>link ptest <ENTER>
The following screen output is generated by the linker:
Microsoft (R) Overlay Linker Version 3.64
Copyright (C) Microsoft Corp 1983-1988. All rights reserved.
Hun File [PTEST.EXE]: <ENTER>
Search WWH ::




Custom Search