i
i
I
Procedure for
Program Calling
H e r e i s t h e e x a m p l e , we
h a v e
p r e s e n t e d i n o r d e r t o s h o w , h o w
t o c a l l s u b r o u t i n e p r o g r a m i n o r d e r t o c o n t r o l I / O d e v i c e s .
T h i s
p r o g r a m h a s b e e n w r i t t e n i n a s s e m b l e r l a n g u a g e ,
t h e r e f o r e , o n e s h o u l d k n o w a s s e m b l e r l a n g u a g e p r o g r a m m i n g v e r y
w e l l b e f o r e g o i n g i n t o h a n d - o n p r a c t i c e
o f
t h i s s u b r o u t i n e
program.
P l e a s e s e e
o u r
b e l o w e x a m p l e .
w h i c h w e h a v e s h o w n
t h e p r o c e d u r e t o r e a d a f i l e b y d i r e c t a c c e s s m e t h o d .
We must specify that you can also read and
write with
the
h e l p o f
B D O S p r o c e d u r e , a l t h o u g h i t t a k e s a l i t t l e
l o n g e r t i m e .
System
Floppy Disk
The System Floppy Disk
Drive Control
operates
by
s e t t i n g c o n t r o l l i n g i n f o r m a t i o n i n
t h e
p a r a m e t e r a r e a
a n d c a l l i n g s u b r o u t i n e .
1.
A t f i r s t , y o u s h o u l d s e t t o t a l 1 3 b y t e s i n t h e p a r a m e t e r
a r e a .
F o r
Refer to the Table 12 FDC Program
Parameter >, f i e l d c o l u m n s ( 1 t o 1 3 )
m e a n s
t o t a l 1 3
b y t e s
a r e a v a i l a b l e .
Y o u c a n a l s o l o o k f o r d e t a i l i n f o r m a t i o n
s u c h a s p a r a m e t e r , l e n g t h a n d c o n t e n t s .
2.
N o w , y o u l o o k a t t h e < T a b l e 1 6
M e m o r y A l l o c a t i o n
o f
F D C
Program Parameter >.
3.
I n s e r t
d i s k e t t e i n t o d r i v e ‘ A ’ .
4 .
Type
'DIR'
press
<RETURN>.
G e t
d i r e c t o r y o f t h e d r i v e ‘ A ’ .
Look for ‘ED COM’
file
as Editor command file.
6 .
Now,
type ‘ED
press <RETURN>.
(For
detail, p l e a s e r e f e r t o o u r F o r m u l a - l ’ s
OPERATING SYSTEM
MANUAL’s page 33 ‘Introduction
to
E D ’
t h o r o u g h l y . )
You will
get
a new file on your CRT and following appears
o n i t : -
: *
8 .
P r e s s ‘I’ and
<RETURN>
key.
A u t o m a t i c a l l y , y o u w i l l g e t l i s t n u m b e r i n o r d e r t o i n p u t
your program.
T y p e y o u r p r o g r a m s t a t e m e n t f r o m y o u r c o d i n g s h e e t , i n o r d e r
t o s e t
c o n t r o l l i n g i n f o r m a t i o n
t h e p a r a m e t e r a r e a a n d
t o c a l l s u b r o u t i n e .
F o r e x a m p l e : - We want to set parameters
for Drive
diskette,
t r a c k
s i d e
s e c t o r
a n d r e a d .
.
; E x a m p l e
List
Program
start
START:
MVI
MVI
MVI
INX
LXX
MOV
INX
MOV
INX
LX1
MOV
INX
MVI
INX
INX
INX
MVI
CALL
JMP
H
H
H
H
H
H
H
H
H
H
M,OFFH
START
s e t
area address
Drive 'B', Side '1'
1 0
5
b y t e s c o u n t 2 5 6
b y t e s
END
m e m o r y a d d r e s s
mode 2
bias
OFH (read mode)
sided diskette
; F D C s u b r o u t i n e c a l l