List Of Interrupts



Print Screen
Interrupt
0x5
Returns 
Nothing
Notes 
Send screen contents to printer. Works in text mode.
 

Get Peripheral Equipment List
Interrupt         
0x11
Input
Nothing
Returns 
AX = equipment list
Notes 
Bit setting for AX are as follows:
00 = disk drive present/absent (0:absent, 1:present)
01 = math co-processor (0:absent, 1:present)
02-03 = RAM in 16 kb blocks
04-05 = initial video mode
00 = (unused)
01 = 40 x 25 colour
10 = 80 x 25 colour
11 = 80 x 25 mono
06-07 = number of disk drives
08 = DMA present (0:present, 1:absent )
09-11 = number of serial ports
12 = game port (0:absent, 1:present)
13 = serial printer
14-15 = number of printers



Reset Disk Controller
Interrupt         
0x13
Input
AH = 0x0
DL = drive
0x00-0x7F floppy disk
0x80-0xFF fixed disk
Returns 
Nothing


Get Disk Status
Interrupt         
0x13
Input
AH = 0x01
DL = drive
0x00-0x7F floppy disk
0x80-0xFF fixed disk
Returns 
AL = status code
Note
Status code values in AL are
AL = 0 : no error
AL = 1 : bad command
AL = 2 : address mark not found
AL = 3 : write attempt to write-protected disk (F)
AL = 4 : sector not found
AL = 5 : reset failed (H)
AL = 6 : floppy disk removed (F)
AL = 7 : bad parameter table (H)
AL = 8 : DMA overrun (F)
AL = 9 : DMA across 64 kb boundary
AL = A : bad sector flag (H)
AL = B : bad track flag (H)
AL = C : media type not found (F)
AL = D : invalid number of sectors on format (H)
AL = E : control data address mark detected (H)
AL = F : DMA arbitration level out of range (H)
AL = 10 : bad CRC
AL = 11 : ECC corrected data error (H)
AL = 20 : NEC controller failure
AL = 40 : seek failed
AL = 80 : time out (failed to respond)
AL = AA : drive not ready (H)
AL = BB : undefined error (H)
AL = CC : write fault (H)
AL = E0 : status register error (H)
AL = FF : sense operation failed (H)
H = fixed disk only, F = floppy disk only


Read Disk Sectors
Interrupt         
0x13
Input
AH = 0x02
AL = number of sectors
CH = track number
CL = sector number
DH = head number
DL = drive number
0x00-0x7F floppy disk
0x80-0xFF fixed disk
ES:BX = pointer to buffer
Returns 
If function successful
Carry flag = clear
AH = 0x00
AL = number of sectors read
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)


Write disk sectors
Interrupt         
0x13
Input
AH = 0x03
AL = number of sectors
CH = track number
CL = sector number
DH = head number
DL = drive number
0x00-0x7F floppy disk
0x80-0xFF fixed disk
ES:BX = pointer to buffer
Returns 
If function successful
Carry flag = clear
AH = 0x00
AL = number of sectors written
If function unsuccessful
Carry flag = set
AH = status code
CF = success/failure flag
AH = status code (refer interrupt 0x13, function 0x01)


Verify Disk Sectors
Interrupt
0x13
Input
AH = 0x04
AL = number of sectors
CH = track number
CL = sector number
DH = head number
DL = drive number
0x00-0x7F floppy disk
0x80-0xFF fixed disk
ES:BX = pointer to buffer
Returns 
If function successful
Carry flag = clear
AH = 0x00
AL = number of sectors verified
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)


Format Disk Track
Interrupt
0x13
Input
AH = 0x05
AL = number of sectors
CH = track number
CL = sector number
DH = head number
DL = drive number
ES:BX = pointer to 4-byte address fields consisting of
byte 0 = track
byte 1 = head
byte 2 = sector
byte 3 = bytes/sector
0 if 128 bytes per sector
1 if 256 bytes per sector
2 if 512 bytes per sector (standard)
3 if 1024 bytes per sector
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)


Get Current Drive Parameters
Interrupt 0x13
Input
AH = 0x08
DL = drive
0x00-0x7F floppy disk
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
BL = drive type (PC/AT floppy disks)
0x01 if 360 kb, 40 track, 5.25"
0x02 if 1.2 mb, 80 track, 5.25"
0x03 if 720 kb, 80 track, 3.5"
0x04 if 1.44 mb, 80 track, 3.5"
CH = low 8 bits of maximum cylinder number
CL = bits 6-7 high-order 2 bits of maximum cylinder number
        bits 0-5 maximum sector number
DH = maximum head number
DL = number of drives
ES:DI = segment:offset of disk drive parameter table
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
On PC/XT this service is supported on fixed disk only.


Initialize Two Fixed Disk Base Tables
Interrupt 0x13
Input
AH = 0x09
DL = drive
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes 
On PC/XT vector for interrupt 0x41 must point to disk parameter table. On PC/AT and above vector for interrupt 0x41 must point to table for drive 0; and the one for interrupt 46 must point to table for drive 1.


Read Long
Interrupt 0x13
Input
AH = 0x0A
AL = number of sectors
DL = drive
0x80-0xFF fixed disk
DH = head number
CH = cylinder number
CL = sector number (see notes)
ES:BX = pointer to buffer
Returns 
If function successful
Carry flag = clear
AH = 0x00
AL = number of sectors read
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes 
This service is supported on fixed disks only. The upper 2 bits of the 10-bit cylinder number are placed in the upper 2 bits of register CL.


Write Long
Interrupt 0x13
Input
AH = 0x0B
AL = number of sectors
DL = drive
0x80-0xFF fixed disk
DH = head number
CH = cylinder number
CL = sector number (see notes)
ES:BX = pointer to buffer
Returns 
If function successful
Carry flag = clear
AH = 0x00
AL = number of sectors written
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only. The upper 2 bits of the 10-bit cylinder number are placed in the upper 2 bits of register CL.


Seek To Cylinder
Interrupt 0x13
Input
AH = 0x0C
CH = lower 8 bits of cylinder
CL = upper 2 bits of cylinder in bits 6-7
DH = head
DL = drive
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only.


Reset Fixed Disk System
Interrupt 0x13
Input
AH = 0x0D
DL = drive
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only.


Test For Drive Ready
Interrupt 0x13
Input
AH = 0x10
DL = drive ID
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only.


Recalibrate Drive
Interrupt 0x13
Input
AH = 0x11
DL = drive ID
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only.


Controller Diagnostics
Interrupt 0x13
Input
AH = 0x14
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This service is supported on fixed disks only.


Get Disk Type
Interrupt 0x13
Input
AH = 0x15
DL = drive ID
0x00-0x7F floppy disk
0x80-0xFF fixed disk
Returns 
If function successful
Carry flag = clear
AH = disk type code
CX:DX = number of 512-byte sectors, when AH = 3
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This function is not supported on the PC or PC/XT. Disk type codes are:
AH = 0 : disk non-existent
AH = 1 : disk, no change detection present
AH = 2 : disk change detection present
AH = 3 : fixed disk


Get Disk Change Status
Interrupt 0x13
Input
AH = 0x16
Returns 
DL = drive that had disk change
0x00-0x7F floppy disk
AH = disk change status
Notes
This function is not supported on the PC or PC/XT. Status codes in AH are:
00 = no disk change
01 = disk changed


Set Disk Type
Interrupt 0x13
Input
AH = 0x17
AL = floppy disk type code
0x00 not used
0x01 320/360 kb floppy disk in 360 kb drive
0x02 320/360 kb floppy disk in 1.2 mb drive
0x03 1.2 mb floppy disk in 1.2 mb drive
0x04 720 kb floppy disk in 720 kb drive
DL = drive
0x00-0x7F floppy disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
Notes
This function is not supported on the PC or PC/XT. Disk type codes for AL are:
AL = 00 : no disk
AL = 01 : regular disk, regular drives
AL = 03 : high-capacity disk in high-capacity drives


Set Media Type For Format
Interrupt 0x13
Input
AH = 0x18
CH = number of cylinders
CL = sectors per track
DL = drive
0x00-0x7F floppy disk
Returns 
If function successful
Carry flag = clear
AH = 0x00
ES:DI = segment:offset of disk parameter table for media type
If function unsuccessful
Carry flag = set
AH = status code (refer interrupt 0x13, function 0x01)
 

Read Next Keyboard Character
Interrupt
0x16
Input
AH = 0x00
Returns 
AH = scan code
AL = ASCII code

Report Whether Character Ready
Interrupt
0x16
Input
AH = 0x01
Returns 
zero flag = 0 - character available to be received,
                1 - no character in keyboard buffer
AH = scan code
AL = ASCII code

Get shift status
Interrupt
0x16
Input
AH = 0x02
Returns 
AL shift status bits
Notes
Shift status bits are
Bit 0 = 1 : Right shift depressed
Bit 1 = 1 : Left shift depressed
Bit 2 = 1 : Ctrl depressed
Bit 3 = 1 : Alt depressed
Bit 4 = 1 : Scroll Lock on
Bit 5 = 1 : Num Lock on
Bit 6 = 1 : Caps Lock on
Bit 7 = 1 : Insert on
 

Reboot  Computer
Interrupt
0x19
Input
Nothing

 
Set Disk Transfer Address
Input
AH = 0x01A
DS:DX = address of disk transfer area
Returns 
Nothing
Notes 
Useful if you want to write your own DIR command


Get FAT Information For Any Drive
Input
AH = 0x01C
DL = Drive number ( 0 = default, 1 = A, 2 = B, etc.)
Returns 
If function successful
DS:BX = Segment offset of Media descriptor
0xF8 - Hard disk
0xFC - 5.25 inch single sided, 9 sector
0xFD - 5.25 inch double sided, 9 sectors
0xFE - 5.25 inch single sided, 8 sectors
0xFF - 5.25 inch double sided, 8 sectors
DX = number of clusters
AL = number of sectors/cluster
CX = bytes/sector
If function unsuccessful (invalid drive or critical error)
AL = 0xFF


Get Disk Free Space
Input
AH = 0x36
DL = Drive number ( 0 = default, 1 = A, 2 = B, etc.)
Returns 
If function successful
AX = number of sectors/cluster
BX = number of available clusters on disk
CX = number of bytes/sector
DX = Total number of clusters on drive
If function unsuccessful (drive invalid)
AX = 0xFFFF
Notes 
Useful if you want to check whether a file can be accommodated on a disk or not.


Make Directory
Input
AH = 0x39
DS:DX = segment:offset address of directory name
Returns 
If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code


Remove Directory
Input
AH = 0x3A
DS:DX = segment:offset address of directory name
Returns 
If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code


Change Directory
Input
AH = 0x3B
DS:DX = segment:offset address of directory name
Returns 
If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code


Delete File
Input
AH = 0x41
DS:DX = segment:offset address of file name
Returns 
If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
Notes 
Wild card characters not allowed in file name.


Get File Attributes
Input
AH = 0x43
AL = 0
DS:DX = segment:offset address of file name
Returns
If function successful
Carry flag = clear
CX = Current file attributes
If function unsuccessful
Carry flag = set
AX = error code
Notes 
File attributes are bit encoded.


Set File Attributes
Input
AH = 0x43
AL = 1
CX = file attributes
DS:DX = segment:offset address of file name
Returns
If function successful
Carry flag = clear
CX = Current file attributes
If function unsuccessful
Carry flag = set
AX = error code
Notes 
File attributes are bit encoded.


Get Current Directory
Input
AH = 0x47
DL = Drive number (0 = default, 1 = A, 2 = B, etc.)
DS:DI= segment:offset address of buffer where DOS places the current directory name.
Returns
If function successful
Carry flag = clear
and buffer is filled with full pathname from root of current directory.
If function unsuccessful
Carry flag = set
AX = error code
Notes 
File attributes are bit encoded.


Find First Matching File
Input
AH = 0x4E
DS:DX = segment:offset address of file name. Filename can contain wild card characters
CX = file attributes used while searching
Returns
If function successful ( matching file found )
Carry flag = clear
Disk transfer area is set up with the file information. The file information is 43 bytes long and contains following details:
0 - 20 reserved bytes
21 file attribute
22 - 23 time of creation/modification
24 - 25 date of creation/modification
26 - 30 file size
31 - 42 file name
If function unsuccessful (no matching files)
Carry flag = set
AX = error code
Notes 
This service is useful if you want to write your own DIR command


Find Next Matching File
Input
AH = 0x4F
Assumes that DTA points to buffer used by previous successful interrupt 0x21, function 0x4E or 0x4E.
Returns
If function successful ( matching file found )
Carry flag = clear
Disk transfer area is set up with the file information. The file information is 43 bytes long and contains detail given in service 0x4E :
If function unsuccessful (no more matching files)
Carry flag = set
AX = error code
Notes 
This service is useful if you want to write your own DIR command


Rename File
Input
AH = 0x56
DS:DX = segment:offset address of file to be renamed. Wild card characters are not allowed.
ES:DI = segment:offset address of new name of file. Wild card characters are not allowed.
Returns
If function successful 
Carry flag = clear
If function unsuccessful 
Carry flag = set
AX = error code
Notes 
The path and new file name can be different than original. However, the drive must be same. In MS-DOS version 3.0 and later, this function can also be used to rename directories.
 

Set Video Mode
Interrupt         
0x10
Input
AH = 0x00
AL = video mode
Returns 
Nothing
Notes 
Video modes in AL are:
0x0 : 40 x 25 text, 16 grey
0x1 : 40 x 25 text, 16/8 colour
0x2 : 80 x 25 text, 16 grey
0x3 : 80 x 25 text, 16/8 colour
0x4 : 320 x 200 graphics, 4 colour
0x5 : 320 x 200 graphics, 4 grey
0x6 : 640 x 200 graphics, mono
0x7 : 80 x 25 text, mono
0x8 : 160 x 200 graphics, 16 colour
0x9 : 320 x 200 graphics, 16 colour
0xA : 640 x 200 graphics, 4 colour
0xD : 320 x 200, 16 colour EGA, VGA
0xE : 640 x 200, 16 colour EGA, VGA
0xF : 640 x 350, mono on EGA, VGA
0x10 : 640 x 350, 4 or 16 colour EGA, VGA
0x11 : 640 x 480, graphics, 2 colours
0x12 : 640 x 480, graphics, 16 colours, VGA
0x13 : 320 x 200, graphics, 256 colours, VGA

Set Cursor Size
Interrupt         
0x10
Input
AH = 0x01
CH = starting scan line
CL = ending scan line
Returns 
Nothing
Notes 
Cursor blinking is under hardware control.

Set Cursor Position
Interrupt         
0x10
Input
AH = 0x02
BH = display page number
DH = row
DL = column
Returns 
Nothing
Notes 
0,0 is upper left. To turn off the cursor, set to (0,25)

Read Current Cursor Position
Interrupt         
0x10
Input
AH = 0x03
BH = display page number
Returns 
CH = starting scan line
CL = ending scan line
DH = row
DL = column

Set Active Display Page
Interrupt         
0x10
Input
AH = 0x05
AL = page number
Returns 
Nothing

Scroll Window Up
Interrupt         
0x10
Input
AH = 0x06
AL = lines to scroll up
BH = filler attribute
CH = upper row
CL = left column
DH = lower row
DL = right column
Returns 
Nothing

Scroll Window Down
Interrupt         
0x10
Input
AH = 0x07
AL = lines to scroll down
BH = filler attribute
CH = upper row
CL = left column
DH = lower row
DL = right column
Returns 
Nothing

Set Colour Palette
Interrupt         
0x10
Input
AH = 0x0B
BH = palette colour ID
BL = colour to be used with palette
Notes 
This works for CGA/EGA/VGA only.

Write Pixel Dot
Interrupt
0x10
Input
AH = 0x0C
AL = pixel value
CX = pixel column
DX = pixel row
BH = page
Returns
Nothing

Read Pixel dot
Interrupt
0x10
Input
AH = 0x0D
BH = page
CX = pixel column
DX = pixel row
Returns
AL = pixel value

Get Current Video Mode
Interrupt
0x10
Input
AH = 0x0F
Returns
AH = number of character columns on screen
AL = video mode
BH = page number


Get Memory Size In kb
Interrupt
0x12
Input
Nothing
Returns
AX = memory size (in kb)
 

Delay
Interrupt
0x15
Input
AH = 0x86
CX, DX = number of microseconds to wait.
Returns 
Nothing

Get extended memory size
Interrupt
0x15
Input
AH = 0x88
Returns 
Nothing
Notes 
Applies to AT and later only.

Send One Byte To Printer
Interrupt
0x17
Input
AH = 0x00
AL = character
DX = printer number (0 = LPT1, 1 = LPT2, 2 = LPT3)
Returns 
AH = success/failure code
Notes
Status code values are
Bit 0 = 1 : time out
Bit 3 = 1 : I/O error
Bit 4 = 1 : printer selected
Bit 5 = 1 : out of paper
Bit 6 = 1 : printer acknowledge
Bit 7 = 1 : printer not busy

Initialise  Printer
Interrupt
0x17
Input
AH = 0x01
DX = printer number (0 = LPT1, 1 = LPT2, 2 = LPT3)
Returns 
AH = status code (refer interrupt 0x13, function 0x01)
Notes
Status code is the same as for service 0x01.

Get Printer Status
Interrupt
0x17
Input
AH = 0x02
DX = printer number (0 = LPT1, 1 = LPT2, 2 = LPT3)
Returns 
AH = status code (refer interrupt 0x13, function 0x01)
Notes
Status code is the same as for service 0x01.


Read Contents Of The Clock Tick Counter
Interrupt
0x1A
Input
AH = 0x00
Returns
AL = midnight signal, 0x00 if midnight passed since last read,
        non-zero otherwise
CX = tick count, high portion
DX = click count, low portion

Set Value In Clock Tick Counter
Interrupt
0x1A
Input
AH = 0x01
CX = tick count, high portion
DX = click count, low portion
Returns
Nothing

Get Current Time From CMOS Time/Date Chip
Interrupt
0x1A
Input
AH = 0x02
Returns
CH = hours in Binary Coded Decimal (BCD)
CL = minutes in BCD
DH = seconds in BCD
DL = 1 if daylight saving time, 0 if standard time
Notes  
Applies to AT and later only.

Set Time In CMOS Time/Date Chip
Interrupt
0x1A
Input
AH = 0x03
CH = hours in Binary Coded Decimal (BCD)
CL = minutes in BCD
DH = seconds in BCD
DL = 1 if daylight saving time, 0 if standard time
Returns
Nothing

Read date from CMOS time/date chip
Interrupt
0x1A
Input
AH = 0x04
Returns
CL = day in Binary Coded Decimal (BCD)
DH = month in BCD
CL = year in BCD
CH = century in BCD

Set Date In CMOS Time/Date Chip
Interrupt
0x1A
Input
AH = 0x05
CL = day in Binary Coded Decimal (BCD)
DH = month in BCD
CL = year in BCD
CH = century in BCD
Returns
Nothing

Set Alarm In CMOS Date/Time Chip
Interrupt
0x1A
Input
AH = 0x06
CH = hours in Binary Coded Decimal (BCD)
CL = minutes in BCD
DH = seconds in BCD
Returns
If function successful
Carry flag = clear
If function unsuccessful
 Carry flag = set
Notes 
The program using this routine must place the address of its interrupt handler for the alarm in the vector for interrupt 0x4A.

Reset Alarm
Interrupt
0x1A
Input
AH = 0x07
Returns
Nothing

0 comments:

Post a Comment