Commodore 1541-II Guía de usuario Pagina 38

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 55
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 37
channel
is
opened much like other files, except that the pound sign
(#),
optionaJi
y 8'{AMPLE:
followed
by
a memory buffer number,
is
used
as
a
file
name.
Here
is
a complete program to read a sector into disk memory using U I , and from
FORMAT FOR DIRECT
ACCESS FILE OPEN STATEMENTS:
dJefC
into computer memory via
Get#.
(If a carriage return will appear at least once
in
every
88
characters
of
data, Input# may be used
in
place
of
Get#)
.
OPEN
file
#,device#,
channel#,
"#buffer#"
where "file
#"
is
the
file
number,
"device#"
is
the disk's device number, normally 8·
"channel#"
is
the channel number, a number between 2 and
14
that
is
not used
by
othe
;
files
open at the same time; and
"buffer#",
if present, is a 0,
l,
2, or 3, specifying
the
memory buffer within the
1541
to
use for this file's data.
EXAMPLES:
If
we don't specify which disk buffer to use, the
1541
will select one:
OPEN
5,8,5,"#"
Or
we
can make the choice ourselves:
OPEN
4,8,4,"#2"
BLOCK-READ
The purpose
of
a Block Read
is
to
load the contents
of
a specified sector into a
file
buffer. Although the Block Read command (B-R)
is
still part
of
the
DOS
1
command set,
it
is
nearly always replaced
by
the
Ul
command.
FORMAT FOR THE
BLOCK-READ COMMAND:
PRINT#l5,
"UI
";channel#;
drive#;
track#;
sector#
where "channel
#"
is the channel number specified when the
file
into which the
bl
ock
will
be
read was opened,
"drive#"
is
the drive number, always 0
on
the
1541
, and
'.'track
#"
and
"sector#"
are respectively the track and sector numbers containing t
he
desired block
of
data to be read into the
file
buffer.
ALTERNATE FORMATS:
PRINT#l5,"Ul:"channel
#;drive #;track
#;sector#
PRINT#l5,"UA:"channel
#;drive #;track
#;sector#
PRINT#l5,"Ul:channel
#,drive
#,track
#,sector#"
66
110
MB
=7936:REM
~!FOO
120
INPUT"TRACK TO
READ";T
130
INPUT"SECTOR TO READ";S
140
OPEN 15,8,15
150
OPEN
5,8,5,"#"
160
PRINT#l5,
"Ul
";5;0;T;S
170
FOR
l=MB
TO
MB+255
180
GET#5,A$:1F
A$="
"
THEN
A$=
CHR$(0)
190
POKE l,ASC(A$)
200NEXT
210 CLOSE 5:CLOSE
15
220
END
Define a memory buffer
Select a track
and sector
Open command channel
Open direct access,channel
Read sector into disk buffer
Use a loop
to
copy disk buffer
into computer memory
Tidy
up
after
As
the loop progresses, the contents
of
the specified track and sector
are
copied into
computer
memory, beginning at the address set
by
variable
MB
in
line 160, and
may
be
examined
and altered there. This
is
the basis for programs like "DISPLAY T &
S"
on
the
Test/Demo diskette.
BLOCK-WRITE
The purpose
of
a Block Write
is
to save the contents
of
a
file
buffer into a specified
sector.
It
is
thus the reverse
of
the Block Read command. Although the Block Write
command
(B-W) is still part
of
the DOS command set, it
is
nearly always replaced
by
the
U2command.
FORMAT
FOR THE BLOCK-WRITE COMMAND:
PRINT#l5,"U2";channel
#;drive #;track
#;sector#
where
"channel
#"
is
the channel number specified when the
file
into which the block•
~ill
be
read was opened; "drive
#"
is
the drive number (always 0 on the 1541); and
_'track
#"
and "sector
#"
are respectively the track and sector numbers that should
receive
the block
of
data being saved from the
file
buffer.
ALTERNATE FORMATS:
PRINT#15,"U2:"channel #;drive #;track
#;sector#
PRINT#l5
,"UB:"channel
#;drive
#;track
#;sector#
PRINT#l5
,"U2
:channel
#,drive
#,track
#,sector#"
67
Vista de pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 54 55

Comentarios a estos manuales

Sin comentarios