TECHNICAL INFORMATION
PHYSICAL LOGICAL
SECTOR SECTOR
13 7
14
18
15
11
16
4
17
15
18
8
JSR [$C004]
Thus, after reading Sector
1,
the
Computer
will
skip "physical" sectors
2, 3, 4,
and 5. The
second
"logical" sector it reads will be "physical"
Sector 6.
A skip factor of 4 is the optimum setting for
BASIC LOADs and SAVEs. However, if
you're not
using BASIC, you might be able to use
a
faster
skip factor. For example:
DSKINI 0r 3
tells the Computer
to
skip
3
physical
sectors
between each logical sector.
.Vote:
It's
difficult
to
determine
the optimum skip
fac-
tor.
We
recommend you leave it at 4 unless you have
a
good understanding
of
how
it
works.
MACHINE-LANGUAGE
DISK
PROGRAMMING
The disk system contains
a
machine-language
routine called DSKCON which
you can call for
all
disk input/output operations. To call this
routine,
you need to write instructions
to
the
Color Com-
puter's 6809 Microprocessor.
See "Using Machine-Language
Subroutines" with
Color BASIC in Getting Started
with
Color BASIC
for the procedures to use in
accessing
a
machine-
language subroutine.
See 6809 Assembly
Lan-
guage Programming, by
Lance Leventhal
(published by Osborne/McGraw-Hill) for the
spe-
cific 6809 instructions.
Information on DSKCON
DSKCON's
entry address is stored in
locations
C004 and C005 (hexadecimal). You
can call
it
with
this assembly-language instruction:
DSKCON's
parameters are located in six memory
locations,
organized as follows:
DCOPC
RMB
1
DCDRV
RMB
1
DCTRK
RMB
1
DSEC RMB 1
DCBPT RMB 2
DCSTA RMB 1
The address of the first,
DCOPC, is contained
in
locations C006 and
C007
(hexadecimal).
You can
use the first five
memory
locations to pass param-
eters to DSKCON.
DSKCON
returns a status byte
to the sixth location,
DCSTA.
These are the parameters
you can pass to the first
five
memory locations:
DCOPC
—
Operation
Code
=
Restore head to track
1
=
No operation
2
=
Read sector
3
=
Write sector
DCDRV
—
Drive Number
to 3
DCTRK
—
Track
Number
to 34
DCSEC
—
Sector Number
1
to
18
DCBPT
—
Buffer Pointer
the address of a 256-byte buffer. For
read
sector, the data is
returned
in
the
buffer.
For write sector, the
data
in
the buffer
is
written on the disk.
This
is the meaning of the status
byte
which
the
DSKCON
routine returns to location DCSTA:
DCSTA
—Status
Bit 7
=
1 Drive Not
Ready
Bit 6
=
1 Write
Protect
Bit 5
=
1 Write
Fault
Bit 4
=
1
Seek
Error
or Record Not
Found
Bit 3
=
1
CRC
Error
Bit 2
=
1 Lost
Data
60