a E i - Commodore Is Awesome
a E i - Commodore Is Awesome
a E i - Commodore Is Awesome
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
T<br />
program h was the tedious wait involved<br />
in e loading some types of program.<br />
wanted m to try and use Nick Hampshire's<br />
a<br />
Fast-save routine (published in<br />
the February 1986 edition of Your<br />
i<br />
<strong>Commodore</strong>) to make fast loading<br />
n<br />
personal copies of any of my own<br />
programs. i To do this I needed to be<br />
able<br />
n<br />
to extract details of programs<br />
From c their headers.<br />
e The Header-Reader program is<br />
quite n simple and makes use of<br />
locations t $0333-$0346 (819-836) which<br />
in i the Plus/4 and C16 are used as a<br />
cassette v tape buffer. Locations $0333<br />
and e $0334 give the start address of the<br />
program f to be loaded, in low-byte<br />
high-byte form, and locations $0335<br />
o<br />
and $0336 give the end address.<br />
Locations<br />
r<br />
$0337 to $0346 contain the<br />
w<br />
16 characters which make up the<br />
r<br />
program name. The header is read by<br />
use i of command OPEN 1 in tine 10.<br />
t<br />
• Line i<br />
1 Set n up screen colours.<br />
g<br />
5 Clear screen, print title.<br />
t<br />
8 Instruction h<br />
to position tape at<br />
header.<br />
e<br />
• Get key press to continue.<br />
10 Open Channel 1 to read header.<br />
15 Clear screen, print title.<br />
18-20 Print contents of locations 819-<br />
838 ($0333-$0346).<br />
30 Translate locations $0337 to $0346<br />
into filename and print.<br />
C/16/PLUS/4 PROGRAM<br />
Tape Head<br />
Reader<br />
Now you can find out more about how your programs<br />
are stored.<br />
By D.A. Gardner<br />
40-60 Convert the low-byte high-byte<br />
address in locations $0333 and $0334<br />
to give the start address of program in<br />
decimal and print.<br />
70-90 Convert the low-byte high-byte<br />
address in locations $0335 and $0336<br />
to give the end address of program in<br />
decimal and print.<br />
92 Subtract the start address from the<br />
end address to give program length<br />
and print.<br />
95 If the start address of the program is<br />
$1001 this is often an indication that<br />
the program is Basic rather than a<br />
book of code. This line communicates<br />
that possibility.<br />
96-98 Option of reading another<br />
header or terminating the program.<br />
PROGRAM: IARE HEADER<br />
0 RED HEADER<br />
-<br />
NER<br />
READER<br />
1 COLOR0,16:COLOR4,6,COLDR1,1<br />
B<br />
5 SCNCLR:CHAR,12,0,"CRVSON)HEADE<br />
R READERCRUSOFFr:PRINT<br />
Y<br />
8 0 CHAR,O,S,"POSITION . 6 A R<br />
TAPE AND TH<br />
EN D PRESS ANY KEYEDOWN)CODWW"<br />
9 SETKEYJS<br />
10 OPEN1<br />
15 SCNCLR:CHAR,12,0,"CRUSDN3HEAD<br />
ER READEKRUSOFE)":PRINT<br />
18 PRINT"C00WN3BY1E5 813<br />
RINI -<br />
20 838:":P F O R I<br />
-<br />
EXTI<br />
0 P R I N T<br />
8 1 9 T 0 8<br />
, FORP<br />
34-8 : P R I<br />
P R. I N T "<br />
N1PEE<br />
CNEXTIPRINT"CRUSOFFJ"<br />
CDOWN B23T<br />
40 K(I);:N<br />
1 ASHEXSCPEEX(820)):8$..HEXSCPE<br />
EK(815)) 1PILEN 0898<br />
4AME<br />
:PRI<br />
RI<br />
NT"E<br />
SS<br />
R1JS<br />
( O N ) '<br />
P<br />
YOUR COMMODORE january 1987<br />
94<br />
Variables<br />
.1$ For GETKEY,<br />
A$ To contain the low-byte<br />
component of the hex start and end<br />
addresses.<br />
BS To contain the high-byte<br />
component of the hex start and end<br />
addresses.<br />
C$ The combined high-byte start<br />
address.<br />
D$ The command high-byte low-byte<br />
end address.<br />
S The decimal start address.<br />
E The decimal end address.<br />
In FOR-NEXT loop.<br />
50 cs-mips(As,3.2)-1-minsces,3,2)<br />
55 5..OECCCS)<br />
60 PRINT;PRINT"(DOWN3START ADORE<br />
SS - "is<br />
70 A S<br />
.<br />
EX(821))<br />
.<br />
80 KEX 0<br />
9<br />
85<br />
S -<br />
E••DEC(DS)<br />
( .<br />
90 PRINI"CDOWNJEND<br />
P E<br />
ADDRESS<br />
ME"; X E<br />
I ( 8<br />
D92 22)) SPRINT"EDOWN/PROGRAM<br />
LENSTH<br />
( r AB<br />
S .<br />
S SS . . , HI EF<br />
C V<br />
9 . ()BRAM X , S2C IS PROBABLY BASIC":ELSEPRI<br />
NT"EDOWNOPROGRAM<br />
) "1001"<br />
PIS E PROBABLY CODE"<br />
+ THENP M<br />
98 CHAR.6,2e,"READ ANOTHER HEADE<br />
IRINT" R? D(Y/N)"<br />
97 S E D( SETKEYJS<br />
8O<br />
W N<br />
,<br />
HEN97 9 1 P, 3R<br />
99<br />
IEJS"Y"A<br />
, 2 IFJS"Y"THENRUNS:ELSEEND<br />
)<br />
NDJS"N"T<br />
1