"IBM personal computer assembly language tutorial" - читать интересную книгу автора (Auerbach J.)

second pass, if the assumption turned out to be wrong, it will report what
is called a "Phase error," a very nasty error to track down. So get in the
habit of putting data and equated symbols ahead of code.

OK. Maybe you understand the program now. Let's walk through the steps
involved in making it into a real COM file.

1. The file should be created with the name HELLO.ASM (actually the name
is arbitrary but the extension .ASM is conventional and useful)

2.

ASM HELLO,,;

(this is just one example of invoking the assembler; it uses the small
assembler ASM, it produces an object file and a listing file with the
same name as the source file. I am not going exhaustively into how to
invoke the assembler, which the manual goes into pretty well. I guess
this is the first time I mentioned that there are really two
assemblers; the small assembler ASM will run in a 64K machine and
doesn't support macros. I used to use it all the time; now that I have
a bigger machine and a lot of macro libraries I use the full function
assembler MASM. You get both when you buy the package).

3. If you issue DIR at this point, you will discover that you have
acquired HELLO.OBJ (the object code resulting from the assembly) and
HELLO.LST (a listing file). I guess I can digress for a second here
concerning the listing file. It contains TAB characters. I have found
there are two good ways to get it printed and one bad way. The bad way
is to use LPT1: as the direct target of the listing file or to try
copying the LST file to LPT1 without first setting the tabs on the
printer. The two good ways are to either

a. direct it to the console and activate the printer with CTRL-PRTSC.
In this case, DOS will expand the tabs for you.

b. direct to LPT1: but first send the right escape sequence to LPT1 to
set the tabs every eight columns. I have found that on some early
serial numbers of the IBM PC printer, tabs don't work quite right,
which forces you to the first option.

4.

LINK HELLO;

(again, there are lots of linker options but this is the simplest. It
takes HELLO.OBJ and makes HELLO.EXE). HELLO.EXE? I thought we were


IBM PC Assembly Language Tutorial 20