Fseek
Seek File
Fseek()
Opcode = 66 ($42)
A llow s y o u to m o v e th e file p o in te r to ch an g e th e po sition in th e file at
w h ich d ata w ill b e re ad o r w ritten .
C macro format
lo n g p ositio n , offset;
in t h an d le , se ek m od e;
p o sitio n = F seek (offset, h an dle, see k m o d e);
Machine language format
m o v e .w
m o v e .w
m o v e .l
m o v e .w
tra p
a d d .l
Inputs
se ek m o d e
h an d le
o ffset
# se e k m o d e , - (sp)
# h a n d le , - (sp )
# o ff s e t, - (sp )
# $ 4 2 , - ( s p )
#1
# 1 0 , sp
w o rd
w o rd
lo n g
A flag th a t in d ic a tes th e p ositio n relativ e
to w h ich th e file p oin te r will m o v e :
0 = B eg in ning of file
1 = C u rre n t p osition
2 = E n d of file
T h e h an d le fo r th e file w h os e p o in te r w ill
be m o ve d .
T h e n u m b er of b ytes to m o v e th e file
p o in ter. A p ositiv e n u m b er m o ve s to w a rd
th e en d of th e file, a n eg ativ e nu m b er
m ov e s to w a rd th e b eg inn ing .
Results
DO p o sitio n lo n g T he ab so lu te cu rre n t p ositio n of th e file p oin ter
afte r th e F s e e k () call, e xp re sse d as an offset fro m
th e sta rt o f th e file.
276