DOS API: Difference between revisions

Content deleted Content added
When ah=2, the register which should contain the character to be written is dl, not al
consistent capitalization, explanation
Line 1:
The '''MS-DOS API''' is an [[API]] used originally in [[MS-DOS]]/[[PC-DOS]], and later by other [[DOS]] systems. The DOSMost APIcalls isto basedthe DOS API oninvoke [[software interrupt]] 21h (int 21h). By calling int 21h with the subfunction in AH and the other parameters in other registers, one invokes various DOS services. DOS services include keyboard input, video output, disk file access, executing programs, memory allocation, and various other things. There are various implementations of the DOS API, including MS-DOS, PC-DOS, DR-DOS, FreeDOS, PTS-DOS, and others. The DOS API is based on the [[BIOS]], and DOS routines often internally access [[BIOS interrupt call]]s.
 
The [[DOS Protected Mode Interface]] extends the DOS API to 32-bits. The MS-DOS API is partially dependent on x86 code hence DOS cannot be ported to other architectures.
Line 10:
 
==Common DOS services==
Some basic int 21h function calls present since DOS version 1.0:
 
{|class="wikitable"
!Subfunction
Line 27 ⟶ 29:
|-
|AH=2h
|dlDL=character
|
|WRITE CHARACTER TO STDOUT
|-
|AH=9h
|dsDS:dxDX=pointer to '$' terminated string
|
|WRITE STRING
|-
|AH=4Ch
|alAL=return value
|never
|TERMINATE PROGRAM