Tandy 1000 Programmer's Reference Manual page 63

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 1
I
System Calls
Example:
The following program creates a file named DIR.TMP on the
disk in Drive
B
that contains the disk number (0
=
A, 1
=
B,
etc.) and filename from each directory entry on the disk.
r e c o r d - s i z e
e q u
f c b l
f c b 2
b u f f e r
f u n c - 1 5 H :
w r
i
t e - i t
:
a l l - d o n e :
db
d b
db
db
d b
s e t - d t a
s e a r c h - f i r s t
C m P
J e
c r e a t e
mov
w r i
t e - 5 e q
s e a r c h - n e x t
C m P
l e
J
mP
c l o s e
1 4
2,"DIR
TMP"
2 5 dup
( 7 )
2 5 dup
( 7 )
l 2 8 d u p
( 7 )
2 ,
" 7 7 7 7 7 7 7 7 7 7
7 "
; o f f s e t o f R e c o r d s i z e
: f i e l d i n F C B
b u f f e r
; s e e F u n c t i o n 1 A H
f c b 2
;see F u n c t i o n 1 1 H
a1
,BFFH
; d i r e c t o r y e n t r y f o u n d ?
a l l - d o n e
; n o ,
no f i l e s o n d i s k
f c b l
; 5 e e
F u n c t i o n 16H
f c b l [ r e c o r d _ s i z e l , l 2
f c b l
;THISFUNCTION
f c b 2
5ee F u n c t i o n 12H
a1
,EFFH
d i r e c t o r y e n t r y f o u n d ?
a1
I - d o n e
n o ,
g o home
w r
i
t e - i t
f c b l
5ee F u n c t i o n 1 E H
; s e t r e c o r d s i z e t o 1 2
y e 5 , w r i t e t h e r e c o r d
61

Advertisement

Table of Contents
loading

Table of Contents