Chapter
1
I
System
Calls
Move
a
File Pointer Function Call
42H
Moves the readlwrite pointer a specified number of bytes accord-
ing
to
the following methods:
0
-
The pointer is moved to the specified offset from
1
-
The pointer
is
moved
to
the current location plus
2
-
The pointer is moved
to
the end of file plus the
the beginning of the file.
the offset.
offset.
Entry Conditions:
AH
=
42H
CX:DX
=
distance to move the pointer, offset in bytes
(CX
contains the most significant part)
AL
=
method of moving
(0,
1,
or
2;
see above)
BX
=
file
handle
Exit Conditions:
Carry set:
Carry not set:
Error Returns:
AX
=
6
AX
=
error code
DX:AX
=
new
file
pointer position
Invalid handle. The handle passed in BX is not cur-
rently open.
Invalid function. The function passed in AL was not
in the range
0-2.
AX
=
1
Example:
LSeek
eq"
42H
mov
dx,offsetlow
mov
cx,offsethigh
mov
a1
,method
mQV
bx
,handle
mQv
ah,LSeek
Int
21
H
114