User1 And User2 - Commodore 1541 User Manual

Disk drive
Hide thumbs Also See for 1541:
Table of Contents

Advertisement

SAMPLE PROGRAM READING BACK 10 RANDOM-ACCESS BLOCKS WITH
4 RECORDS EACH:
10
OPEN15,8,15
20
OPEN5,8,5,"#"
30
OPEN4,8,4,"KEYS,S,R"
40
FORR=lTO10
50
INPUT#4,T,B
60
PRINT#15,"B-R:"5;0;T;B
70
FORL=1TO4
80
PRINT#15,"B-P:"5;(L-1)*64+1
85
INPUT#5,A$,X
90
IF A$< >"RECORD CONTENTS #" OR X< >L THEN STOP
95
PRINT R;A$;L
100 NEXT L
110 PRINT#15,"B-F:"0;T;B
120 NEXT R
130 CLOSE4:CLOSE5
140 PRINT#15,"S0:KEYS"
150 CLOSE15
USER1 and USER2
The USER commands are generally designed to work with machine language (see
chapter 8 for more on this). The USER1 and USER2 commands are special versions of
the BLOCK-READ and BLOCK-WRITE commands, but... with an important dif
ference: the way USER1 and USER2 work with the buffer-pointer.
The BLOCK-READ command reads up to 256 characters, but stops reading when
the buffer-pointer stored with the block says that block is finished. The USER1 com
mand performs the BLOCK-READ operation, but first forces the pointer to 255 in
order to read the entire block of data from the disk.
FORMAT FOR USER1 COMMAND
PRINT#file#, "Ul:" channel; drive; track; block
or
PRINT#file#, "UA:" channel; drive; track; block
There is no difference between the Ul and UA designations for this command.
34

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents