Atari 800 Manuel de l'opérateur Page 77

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 92
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 76
Now start writing
a BASIC
program,
begin with:
2 DIM ES(2179i
Ther add
this
subroutine
(which
you
can delete later):
25OOO A
=90*J+
1:B
=A+89:
II B > LIMIT THEN
B
=LIMIT:?"LAST
LINE"
250101
+
5;"E$(";A;",",B,")
-
";CHR$(3a);
25020 FOR I-A TO B:?..8M
@,,;CHR$(PEEK)I+C));:NEXT
I
25030 ?CHR$(34)J
-l
+1:RETURN
Herc the
m W
symbol mans ihat
you
pre$
the escape key twice. Now
tyT)e
in the following direct comnands:
J= 0 ff i
c
=
p2a7
sqw
LIMIT=2179
ffi
The valu ofc is the address ofthe b]'ie before the lirst byte ofyoru
plograIn.
The
value of LIMIT is the length of
youl
objeci
program.
Now type
GOSUB
25000
gffiffi.
The computer will
prini
a BASIC line
onto the
screen. It will look very
strange-all sorts of strang characters inside a string. They are the scren
representation
ofyour object code. To make this lin
part
ofyou BASIC
prgram
simply move
the cursor up to the line and
press
ffid&.
You might reassue
yourself
ihat
you
were succe$ful
by entering:
LrsT 5
S:fSW&
and vedfying that line 5 raly
did
go in. Now
type GOSUB 25000
@!
again
and another line \vill be pdnted. Enter
this one the same
way
as before.
Continue this
process
of printing
ard
entering lines
until the entire object
program
has been encoded inside BASIC statemnts. You will know
you
have
reached
this
point
when the computer
pdnts
"LAST
LINE
'
onto the screen.
There is
one
po$ible
hitch
with
this
process.
If
you
have a hex code of
$22
(decimal
value
34) anywhere in
your
code it wil be
put
onto the sceen as a
double
quotation
mark. This will confuse ihe BASIC interyreter, which
ltvill
give you
a
syntax
error when
you
try to enter the line. Ifihis happens, carefuly
count which
byte is th oftndr and wdte down the index ofthe anay which
should
contain the double
quotation
mark. Then
go
back and replac th
offending
quotation
mark with
a blank space; that will keep the BASIC
interyreter happy. Make not
of all 6uch occumences.
When you
are done
entering th characters, iype in
a
fw more
lines
like:
30 E$(292, 292)
=
CHR$(34)
This line
puts
the double
quotation
mark into
the 292nd array elemnt by brute
force. It should come immediately
after
the lines
that declare the string. You
should have a line similar to this for each instance
ofihe double ouotation
mark.
Ma}.e sure
lhat
you
have counted
properly
and
pur
rhe double
quotarion
marks
into the right
places.
Now
your
object
program
is a
part
ofthe BASTC
plograIn.
You can
SAVE and
LOAD the BASIC program
and the object
prcgram
will be saved
and loaded
along with ii-a great
convenience. You can run the objct program
by
running
the BASIC program
and then executing the command:
Vue de la page 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 91 92

Commentaires sur ces manuels

Pas de commentaire