MORE INFORMATION
To start the DEBUG utility, type "debug" (without the quotation marks)
at the command prompt and press ENTER. If at any time you wish to exit
and start over, use the Q[uit] command to exit back to MS-DOS. It is
recommended that DEBUG not be used when other programs are active or in a
multitasking environment such as Microsoft Windows.
DEBUG
Displays Enter To
-------- ----- --
- a 100 Begin entering commands at address 100
XXXX:0100 int 13 Do an interrupt 13
XXXX:0102 int 20 An interrupt 20 here (insurance)
XXXX:0104 ENTER Press ENTER here
- rip Display and modify the IP register
IP XXXX
: 0100 Begin executing at 100
- rax Display and modify AX register
AX 0000
: 0800 Function 8 (get drive information)
- rdx Display and modify DX register
DX 0000
: <drive> Enter 0 for first floppy, 1 for
second, and so on
- p Process
At this point, DEBUG will execute the command at 0100, interrupt 13. The
ROM BIOS routine will process interrupt 13, function 8, on the drive you
specified, and return some information in the registers. DEBUG will display
something like this:
AX=0000 BX=0002 CX=4F0F DX=0102 SP=FFEE BP=0000 SI=0000 DI=2115
DS=0E77 ES=F000 SS=0E77 CS=0E77 IP=0102 OV UP EI NG NZ NA PO NC
0E77:0102 CD20 INT 20
The name of each register is displayed, along with its current value.
All values are in hexadecimal. Note that each X register can also be
addressed by its "high" and "low" halves; that is, if CX=4F0F, CH=4F
and CL=0F.
The flags register is displayed differently. The status of the flags
register is the series of two-letter codes at the end of the second
line. Note the value of the last flag on the second line. If it is CY
(CarrY), the carry flag was set by the BIOS, which means the interrupt
failed. In this case, AX= an error value. See page 54 of the "IBM ROM
BIOS Quick Reference" guide for information about these errors. If the
last flag is NC (no carry), the carry flag was not set, which
indicates that the interrupt worked correctly.
On AT and PS/2 systems, the low byte of the BX register (BL) will
contain the drive type 01 if 360, 02 if 1.2, 03 if 720, and 04 if
1.44.
The maximum value for the last track on the drive is stored in CH: 27
hexadecimal (39 decimal) if there are 40 tracks maximum, or 4Fh (79d)
if there are 80 tracks. The maximum sector number is stored in CL: 9h
(9d), Fh (15d), 12h (18d), or 24h (36d). Finally, the maximum head
number is stored in DH; because floppies have two heads, this is 1.
(The ROM BIOS numbers heads and tracks, or cylinders, from 0, and
sectors from 1.)
Finally, DL indicates the number of floppy drives. Note that the value
returned in DL (number of drives) is the number of floppy drives
attached to the disk controller for the specified drive. Normally,
there is only one controller, and thus DL=the total number of
floppies. However, if floppies A and B are attached to different
controllers, then DL=1 will be returned for each.
So, from the previous example (values unrelated to the drive type are
indicated by xx):
AX=xxxx BX=xx02 CX=4F0F DX=0102 SP=xxxx BP=xxxx SI=xxxx DI=xxxx
DS=xxxx ES=xxxx SS=xxxx CS=xxxx IP=xxxx xx xx xx xx xx xx xx NC
xxxx:xxxx xxxx xxx xx
NC, so no error; BL = 02, so 1.2 MB; CH=4F, or 80 tracks; CL=0F, or 15
sectors per track; DH=01, or 2 heads; DL=2, two drives. All of which
indicates that there are two drives on this system, and this particular
floppy drive is 1.2 MB.