EasyManua.ls Logo

Commodore Plus 4 - Page 328

Commodore Plus 4
464 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...
316
Machine
Language
on
the
Commodore
Plus/4
SFFF3
IOBASE
Registers
Altered:
.X,
.Y
Returns
$00
(the
low
byte
of
the
1/
O
base
address)
in
.X
and
$FD
(the
high
byte
of
the
I/O
base
address)
in
.Y.
This
subroutine
is
useful
only
for
programs
intended
to
run
on
other
Commodore
computers.
$FFF6
RESET
Registers
Altered:
all
Does
a
warm
reset
of
the
Plus/4.
If
the
STOP
key
is
detected,
this
routine
goes
to
the
MONITOR,
leaving
the
contents
of
memory
intact.
If
STOP
is
not
detected,
the
Plus/4
goes
to
BASIC
with
the
contents
of
memory
reinitialized.
Interfacing
with.
BASIC
Sometimes
it
is
desirable
to
combine
BASIC
and
machine
language
to
get
the
advantages
of
both.
This
can
be
done
in
a
number
of
ways,
including
changing
the
operating
system
vectors
($0300-$0331).
The
most
common
methods
include
the
USR
function,
the
SYS
command,
and
adding
a
BASIC
wedge
(a
custom
command
set).
These
methods
are
discussed
in
this
section.
The
USR
Function
USR
is
a
floating
point
function.
The
syntax
is
TJSR(x)
where
*
is
a
numeric
expression.
The
USR
function
places
the
value
of
its
argument
in
floating
point
accumulator
#1
($61-$66)
and
then
passes
control
of
processing
to
the
address
contained
in
the
USR
vector
at
$0501-$0502
(1281-1282).
These
locations
are
initialized
so
as
to
cause
an
ILLEGAL
QUAN
TITY
error
if
the
USR
function
is
called
without
changing
their
values.
The
USR
function
returns
to
the
BASIC
program
the
value
in
floating
point
accumulator
#1
when
its
execution
is
complete.
The
machine
code
routine
pointed
to
by
the
USR
vector
must
be
terminated
with
an
RTS
to
return
control
to
BASIC.
The
Floating
Point
Accumulator
Locations
$61-$66
comprise
the
value
con
tained
in
floating
point
accumulator
#1.
The
number
is
stored
in
exponential
form.
The
absolute
value
resides
in
$61-$65.
Bit
7
(the
sign
bit)
of
location
$66
indicates
the
sign
of
the
number
(if
bit
7
is
set
to
1,
the
number
is
negative;
otherwise
it
is
nonnegative).
A
value
of
zero
is
indicated
by
setting
$61
(which
is