Fopen
Open File
Opcode = 61 ($3D)
Fopen()
O p e n s a specified file, a n d retu rn s a 16-b it h an d le th a t can b e u se d for
fu rth er a cce ss to th e file.
C macro format
c h a r *fn am e ;
in t h an d le , m o d e;
h an d le = F op en (fn am e, m o d e);
Machine language format
# m o d e , - (sp )
fn am e, - (sp )
# $ 3 D , - (sp )
#1
m o v e .w
m ov e.l
m o v e.w
trap
ad d q .l
Inputs
m od e
# 8 ,s p
w o rd
fn am e
Results
DO h an d le
lo ng
w o rd
A flag th at sp ecifies w h ich op era tio n s w ill
b e availab le o n ce th e file h as b ee n
o p en ed .
0 = R ea d on ly
2 = W rite on ly
3 = R ead o r W rite
A p o in ter to a n u ll-te rm in ate d A SC II
strin g co ntain in g th e n a m e o f th e file to
o p en .
If th e fu n ction su cce e d s, a 16-b it h an d le v alu e. If
n o t, a n eg ativ e G EM D O S e rro r n u m b er.
See also
F c r e a te ( ), F c lo s e ()
271