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

b. SS is used to complete an address if BP is used in its formation.
Otherwise, DS is always used to complete a data address.

c. On the string instructions, the target is always formed from ES and
DI. The source is normally formed from DS and SI. If there is a
segment prefix, it overrides the source not the target.



IBM PC Assembly Language Tutorial 11


Learning about DOS __________________ Learning about DOS Learning about DOS Learning about DOS


I think the best way to learn about DOS internals is to read the technical
appendices in the manual. These are not as complete as we might wish, but
they really aren't bad; I certainly have learned a lot from them. What you
don't learn from them you might eventually learn via judicious disassembly
of parts of DOS, but that shouldn't really be necessary.

From reading the technical appendices, you learn that interrupts 20H
through 27H are used to communicate with DOS. Mostly, you will use inter-
rupt 21H, the DOS function manager.

The function manager implements a great many services. You request the
individual services by means of a function code in the AH register. For
example, by putting a nine in the AH register and issuing interrupt 21H you
tell DOS to print a message on the console screen.

Usually, but by no means always, the DX register is used to pass data for
the service being requested. For example, on the print message service
just mentioned, you would put the 16 bit address of the message in the DX
register. The DS register is also implicitly part of this argument, in
keeping with the universal segmentation rules.

In understanding DOS functions, it is useful to understand some history and
also some of the philosophy of MS-DOS with regard to portability. General-
ly, you will find, once you read the technical information on DOS and also
the IBM technical reference, you will know more than one way to do almost
anything. Which is best? For example, to do asynch adapter I/O, you can
use the DOS calls (pretty incomplete), you can use BIOS, or you can go
directly to the hardware. The same thing is true for most of the other
primitive I/O (keyboard or screen) although DOS is more likely to give you
added value in these areas. When it comes to file I/O, DOS itself offers
more than one interface. For example, there are four calls which read data
from a file.

The way to decide rationally among these alternatives is by understanding
the tradeoffs of functionality versus portability. Three kinds of porta-