EasyManua.ls Logo

Atari ST series - Page 282

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Fwrite
Write File
Fwrite() Opcode = 64 ($40)
T his fu nction w rite s a sp e cified n u m b er of b y tes to a n o p en file.
C macro format
lo n g s ta tu s, b y te s;
in t h an d le;
c h a r ^bu ffer;
statu s = F w rite(h a n d le , b y te s, b uffer);
Machine language format
m o v e .l b uffer, - (sp )
m o v e .l # b y t e s , - (sp )
m o v e .l # h a n d le , - (sp)
m o v e .w
# $ 4 0 , - ( s p )
trap
# 1
a d d .l # 1 2 , sp
Inputs
b uffer
lo n g A p o in te r to th e bu ffe r w h ere th e d ata to
b e w ritte n is sto re d .
b y tes
lo n g
T he n u m b e r of b yte s to w rite . N o te : T h is
m u st be a lon g valu e.
h an d le
w o rd
T he file h an d le o f th e file to w rite to .
Results
DO statu s w o rd If th e fu n ction su cce e d s, th e actu al n u m b er of b ytes
w ritten is retu rn ed . If n o t, a n eg ativ e G EM D O S e r
ro r n u m b er is re tu rn ed
See also
F o p e n (), F c lo s e ()
274