home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 2
/
002.d81
/
p_p_s#4
< prev
next >
Wrap
Text File
|
2022-08-26
|
2KB
|
129 lines
PEEK/POKE/SYS -- Part 4
==== ==== === ==== =
--------------------------------------
Location: 2 Hexadecimal: $0002
Official Label: none Type: RAM
Useful BASIC commands: PEEK-POKE-SYS
The Programmer's Reference Manual
says that this byte is "Unused". A
pre-release version of the manual says
"DO NOT USE!". I don't know why.
Location 2 is not used by the BASIC
or Kernal. It normally contains a
Zero (0 - BRK instruction). Thus, it
could be used as a free zero-page
location in your own machine language
programs, but this is not recommended
for the following reason: Since the
BRK instruction acts like a software
interrupt, it is nice to be able to
produce one from BASIC. With a guar-
anteed BRK at location 2, all you need
to do is SYS 2. Normally, this resets
the VIC-II chip and the Screen Editor,
clearing the screen (just like RUN/
STOP-RESTORE!). But with, say, HESMON
or some other monitor installed, a BRK
instruction allows quick entry into
the monitor from BASIC.
--------------------------------------
Locations: 3&4 Hexadecimal: $0003
Official Label: ADRAY1 Type: RAM
Useful BASIC commands: PEEK, POKE
ADRAY1 is a two-byte Jump Vector.
A Jump Vector is simply the address of
a routine that is called by an indi-
rect JMP instruction to the vector it-
self. Because the JMP is indirect,
the machine-language routine called is
at the contents of the vector, not the
vector itself. It is like saying, 'Go
to my desk, look at the sheet of paper
there, and on that paper you will find
Mr. Smith's address.' instead of say-
ing, 'Go to this address to find Mr.
Smith: '. The sheet of paper is anal-
ogous to a Jump Vector. It contains
the address of the destination. Be-
cause the Vector is in RAM, it can be
changed to allow a user-written rou-
tine to be substituted for the normal
routine.
ADRAY1 is a vector to the subrou-
tine at $B1AA that converts the float-
ing point (real) number last used into
a two-byte integer in the .A and .Y
registers (.Y is the low byte). This
is used mostly by user-written USR()
functions. BASIC itself does not use
this vector. It is there so that a
USR() function can use that routine to
convert its argument, even in future
versions of Commodore 64 BASIC, when
the routine itself might have been
moved. The ADRAY1 vector will NOT be
moved!
-----------<end of article>-----------
<x to exit>