Compilation Basics (2) 21H interrupts

Source: Internet
Author: User
Tags file size

 

INT 21H Interrupt

AH

Function

Calling parameters

return parameters

xx

program termination (same as int 20H)

cs= program Segment prefix

 

on

keyboard input and Echo

 

al= Input Characters

Geneva

Display Output

dl= Output Characters

 

Geneva

Asynchronous Communication Input

 

al= input Data

Geneva

Asynchronous communication output

dl= Output Data

 

to

Printer Output

dl= Output Characters

 

.

Direct console I/O

dl=ff (Input)

dl= character (output)

al= Input Characters

-

keyboard input (no echo)

 

al= Input Characters

,

keyboard input (no echo)

Detection Ctrl-break

 

al= Input Characters

the

Display String

ds:dx= String Address

' $ ' End string

 

0A

keyboard input to buffer

ds:dx= Buffer First address

(DS:DX) = maximum number of characters in a buffer

(ds:dx+1) = number of characters actually entered

0B

Verify keyboard status

 

al=00 has input

AL=FF No input

0C

clears the input buffer and

request the specified input function

al= Input Function number

(1,6,7,8,a)

 

0D

Disk Reset

 

Purge file Buffers

0E

Specifies the current default disk drive

dl= Drive letter 0=a,1=b,...

number of al= drives

0F

Open File

DS:DX=FCB First Address

al=00 file found

al=ff File not found

Ten

Close File

DS:DX=FCB First Address

al=00 Directory modified successfully

file not found in Al=ff directory

One

Find First Catalog item

DS:DX=FCB First Address

al=00 found

al=ff not found

A

Find Next Catalog Item

DS:DX=FCB First Address

(file with * or?)

al=00 found

al=ff not found

-

Deleting Files

DS:DX=FCB First Address

al=00 Delete succeeded

al=ff not found

-

Sequential Read

DS:DX=FCB First Address

al=00 Read Success

= 01 End of file, no data in record

=02 DTA space is not enough

= 03 End of file, incomplete record

the

Sequential Write

DS:DX=FCB First Address

al=00 Write Success

= 01 Disk Full

=02 DTA space is not enough

-

Building Files

DS:DX=FCB First Address

al=00 Build Success

=ff No disk space

-

file Renaming

DS:DX=FCB First Address

(ds:dx+1) = old file name

(ds:dx+17) = new file name

al=00 Success

Al=ff not successful

+

take the current default disk drive

 

al= The default drive letter 0=a,1=b,2=c,...

1 A

Place the DTA address

DS:DX=DTA Address

 

1 B

take the default drive fat information

 

al= Number of sectors per cluster

Ds:bx=fat Identity Byte

cx= Physical Sector size

dx= the number of clusters for the default drive

1C

take any one of the drive fat information

dl= Drive Letter

Ibid .

+

Random Read

DS:DX=FCB First Address

al=00 Read Success

= 01 End of File

= 02 Buffer Overflow

= 03 Buffer not satisfied

A

Random Write

DS:DX=FCB First Address

al=00 Write Success

= 01 Disk Full

= 02 Buffer Overflow

at

measure File Size

DS:DX=FCB First Address

al=00 Success (file length filled in FCB)

al=ff not found

-

set random record number

DS:DX=FCB First Address

 

-

Set Interrupt vectors

ds:dx= Interrupt Vector

al= Interrupt class model

 

-

Creating a program segment prefix

dx= new program segment prefix

 

-

Random block Reading

DS:DX=FCB First Address

cx= Record Count

al=00 Read Success

= 01 End of File

= 02 buffer too small, transfer end

= 03 Buffer not satisfied

-

Random block Write

DS:DX=FCB First Address

cx= Record Count

al=00 Write Success

= 01 Disk Full

= 02 Buffer Overflow

in

Parse file name

ES:DI=FCB First Address

Ds:si=asciiz String

al= Control Analysis Flag

al=00 standard File

= 01 Multi-semantic Files

= 02 Illegal drive letter

2A

Date Taken

 

cx= Year

dh:dl= Month: day (binary)

2B

Set Date

cx:dh:dl= Year: Month: Day

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.