News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

about registry and interrupt

Started by applechu, March 08, 2012, 03:20:26 PM

Previous topic - Next topic

applechu

Hi:
I encounter some questions about ax, bx,ds and interrupt.
the codes are as following:

mov dx, @data
mov ds, dx
mov bx OFFSET something
..


and


mov ax, @data
mov ds, ax
mov ah, 01h
int 21h


The main problem is I feel confused about these relation.
I didn't know when to use each of them , and even I know their definition,
I still can not figure out how they works. is there any relationship between each of them
and how they work together. Thanks a lot.

dedndave

Ralf Brown's Interrupt List...

If you intend to continue writing 16-bit programs, I suggest you download Ralf Brown's Interrupt List:

http://www.cs.cmu.edu/~ralf/files.html

The list is organized in 6 ZIP files (inter61a.zip-inter61f.zip). This is the most complete list of interrupts available.
Most of the information you will need is in the first 2 ZIP files (inter61a.zip and inter61b.zip).

The files are fairly large text files. If you look down the list a little further, there is a program for viewing them.
It is called Ralf Brown Interrupt List Viewer, or simply RBIL Viewer (rbilv21.zip).

The individual text files have names like INTERRUP.A, INTERRUP.B, and so on.
You may want to rename them to something like INT_A.TXT, INT_B.TXT, etc. to make them easier to use.

Ralf's List has a lot of information you may never use, because they try to make it complete.
On the other hand, it is full of useful tables and structure definitions that are hard to find elsewhere.

also - for a quick reference, Randy Hyde's AOA

http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/toc.html

Chapter 13  BIOS, DOS, and File I/O     (includes information on the interrupt services)

....
however, 16-bit code is becoming obsolete
much better to learn 32-bit code   :U

MichaelW

Regarding DS, most instructions that access data (normally) use DS. For a 16-bit DOS .EXE the program loader sets DS to the segment address of the Program Segment Prefix (PSP). The PSP is a 256-byte block of memory that precedes the program in memory. The OS uses the lower 128 bytes of the PSP to store various values that it uses to manage the program, and the upper 128 bytes to store the program's command line. To access the program's data segment you must load the segment address of the data segment into DS. This is what the:

mov dx, @data
mov ds, dx

and:

mov ax, @data
mov ds, ax

are doing.
eschew obfuscation

applechu


FARMER-OAK

Yes Ralphs interrupt list is quite good.
However if your do an interrupt to..Get SuperVGA info...don't expect the information to be correct.
There once was an attempt to standardise things under what was called VESA, but then video card
manufacturers seemed to all go their own way.

Maybe 32 bit programming is the way to go :U