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



making a COM program, not an EXE program. Right. HELLO.EXE isn't
really executable; its just that the linker doesn't know about COM pro-
grams. That requires another utility. You don't have this utility if
you are using DOS 1.0; you have it if you are using DOS 1.1 or DOS 2.0.
Oh, by the way, the linker will warn you that you have no stack
segment. Don't worry about it.

5.

EXE2BIN HELLO HELLO.COM

This is the final step. It produces the actual program you will exe-
cute. Note that you have to spell out HELLO.COM; for a nominally
rational but actually perverse reason, EXE2BIN uses the default exten-
sion BIN instead of COM for its output file. At this point, you might
want to erase HELLO.EXE; it looks a lot more useful than it is.
Chances are you won't need to recreate HELLO.COM unless you change the
source and then you are going to have to redo the whole thing.

6.

HELLO

You type hello, that invokes the program, it says

HELLO YOURSELF!!!

(oops, what did I do wrong....?)



What about subroutines? _______________________ What about subroutines? What about subroutines? What about subroutines?


I started with a simple COM program because I actually think they are easi-
er to create than subroutines to be called from high level languages, but
maybe its really the latter you are interested in. Here, I think you
should get comfortable with the assembler FIRST with little exercises like
the one above and also another one which I will finish up with.

Next you are ready to look at the interface information for your particular
language. You usually find this in some sort of an appendix. For example,
the BASIC manual has Appendix C on Machine Language Subroutines. The
PASCAL manual buries the information a little more deeply: the interface
to a separately compiled routine can be found in the Chapter on Procedures
and Functions, in a subsection called Internal Calling Conventions.

Each language is slightly different, but here are what I think are some