EasyManua.ls Logo

Commodore Plus 4 - Page 351

Commodore Plus 4
464 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...
The
Disk
Drive
339
Line-by-Line
Explanation
10
Open
the
command
channel
and
initialize
the
disk.
20
Check
for
error.
If
one
is
found,
exit.
30
Open
the
direct
access
channel.
40
Check
for
error.
If
one
is
found,
exit.
50
Ask
for
a
string
to
write.
60
Put
the
input
string
followed
by
a
carriage
return
in
the
buffer
of
the
1541.
70
Ask
which
track
and
sector to
use.
80
Write
the
buffer
to
the
disk.
90
Check
for
error.
If
one
is
found,
exit.
100
Read
the
sector
back
into
the
buffer.
110
Check
for
error.
If
one
is
found,
exit.
120
I
will
count
the
bytes.
130
Get
1
byte
from
the
buffer.
140
Output
the
byte
to
the
screen.
150
If
the
byte
is
a
carriage
return,
the
end
of
the
string
has
been
reached.
Otherwise,
go
on
to
the
next
byte.
160
Close
the
files.
Block
Allocate
(B-A)
The
BAM
is
a
record
of
which
sectors
on
the
disk
are
in
use.
When
a
sector
is
allocated,
it
is
safe
from
being
written
on
by
the
DOS
in
the
course
of
normal
writing
(such
as
a
SAVE).
It
is
not
safe
from
being
written
on
by
the
direct-access
commands,
nor
is
it
safe
from
being
deallocated
by
a
validate
(COLLECT)
operation.
The
block
allocate
command
updates
the
BAM
to
show
the
designated
sector
as
used.
The
BAM
is
actually
written
out
to
the
disk
when
a
direct-access
channel
is
closed,
so
it
is
a
good
idea
to
open
and
close
a
direct-access
channel
when
allocating
a
block,
even
if
it
is
not
needed
for
any
other
purpose.
The
syntax
for
a
block
allocate
is
PRINT*
fUenumber;'B-A:";drive;track;sector
where
Jilenumber
is
the
logical
file
number
of
the
command
channel
and
drive
is
the drive
number.
The
track
can
be
any
track
on
the
diskette
(1
to
35)
and
the
sector
any
sector
of
that
track.