EasyManua.ls Logo

Commodore RF512C - Direct - Block Programming

Commodore RF512C
52 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...
34
DIRECT
-
BlO
CK PROGRAMMING
Ot
he
r then file
opera
ti
on, Jser
can
directly mainpulate the disk
itself wi
th
very
less
involute in
prog
r
amm
ing.The way
is
using the
drive
RAM
as buffer for
data
processing.
Demo for
block
read, write
and
its
paint
er.
10
INPUT
"
DI
SK
ID
':X$
20
CLO
SE
1:0
PEN
1,
8,15
30
CL
OS
E 2:0
PEN
2,8,2,
"#"
40
PRINT.!'
1,
"
UI
:2 0";18:0
50
PRINT'"
1,
"B-P";2;162
60
GET.!'
2.1S
:
GET#2,DS
:
IDS
=
IS+DS
70
PRIN
T"
OLD
10
I
S";
IO
$
80
PRINT'"
1,
"B
-P
";2;162
90
PRINT'"
2,X$
100
PRINT#
1, "U
2:
2 0
";
18;0
110
CL
OSE
2:CL
OS
E 1
LIN
E
10
: Input new disk
10
code
LINE
20:
Open
command
channel
LINE
30:
Open
buffer channel
or
one
can
put a speci
fi
c buffer number affer "
#"
LINE
40:
Using
U1
to
substi
tute block-read on track 18 sector 0
LINE
50:
Set
block-pointer to
162
(i.e.
ID
code
location)
LINE
60:
Get
10
LINE
70:
Display the old 10
LIN
E
80:
Again,
set
pointer to
162
LINE
90: Input new
10
into buffer
LINE
100
: Using U2 to substitute blOCk-write on track18 sector 0
LINE
110:
Close file
Oemo for
bl
oc
k
-ass
ign
fun
ction
10
CL
OS
E
1:0
PEN
1,
8,15
15
PRINT#
1,
"I
C6"
20
PRINT#
1,
"B
-F:'0;18;1
30
PRINT'"
1,
"B-A
"0;18;1
40
G
OS
UB
100
50
PR
I
NT.!'
1,
"B-A"0;18;1
60 GOS
UB
100
70
ENO
:
RE
M free the block
:R
EM
allocate
such block
:R
EM
OK
message
:
REM
al
locate
it
again
:
REM
no
block now