Chapter
1
I
System Calls
Absolute
Disk
Write
Interrupt
26H
Transfers control
to
the
MS-DOS
BIOS. The number
of
sectors specified in CX is written from the Disk Transfer
Address
to
the disk.
This call destroys all registers except the segment regis-
ters. Be sure
to
save any registers your program uses be-
fore issuing the interrupt.
The system pushes the flags at the time of the call; they
are still on the stack upon return. This is necessary be-
cause data
is
passed back
in
the current flags. Be sure
to
pop the stack upon return
to
prevent uncontrolled
growth.
Entry Conditions:
AL
=
drive number
(0
=
A,
1
=
B,
etc.)
DS:BX
=
Disk Transfer Address
CX
=
number
of
sectors to write
DX
=
beginning relative sector
E
xi t Conditions:
Carry set:
Carry not set:
Error Returns:
Error codes are the same as for Interrupt
24H.
Macro
Definition:
AL
=
error
code
Operation was successful.
ab5-disk-write macro
dist,buffer,num_sectors,first_sector
mov
a1,disk
mov
bx,offset buffer
mov
cx,num-sectors
mov
dx,first-sector
int
26H
endm
POPf
22