EasyManua.ls Logo

Commodore Plus 4 - Page 285

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...
The
6502
Microprocessor
873
The
value
in
the
accumulator
is
stored
in
the
location
indicated
by
the
stack
pointer,
and
the
stack
pointer
is
decremented.
Example:
This
program
continuously
changes
the
border
color
until
a
key
is
hit.
The
PH
A
instruction
is
used
to
save
the
original
color
of
the
border
on
the
stack
for
restoration
after
the
key
hit.
2000
AD
19
FF
LDA
$FF19
2003
48
PHA
S004
20
OC
20
JSR
$2000
2007
68
PLA
2008
8D
19
FF
STA
$FF19
200B
00
BRK
200C
EE
19
FF
INC
$FF19
200F
20
E4
FF
JSR
$FFE4
2012
FO F8
BEQ
$2000
2014
60
RTS
Get
the
current
border
color.
Save
on
the
stack.
Execute
the
border
color
change
subroutine.
Retrieve
the
original
border
color.
Restore
the
original
border
color.
Stop
processing.
Increment
the
border
color.
Look
for
a
key
hit.
If
no
key,
then
go
back.
Exit
the
subroutine.
PHP—Push
Processor
Status
Register
onto
the
Stack
The
value
currently
in
the
processor
status
register
is
pushed
onto
the
stack.
Operation:
SR
\
Addressing
Mode
Syntax
Flags
Affected:
None
Opcode
Bytes
Cycles
Implied
PHP
08
1
The
value
in
the
processor
status
register
is
stored
in
the
location
indicated
by
the
stack
pointer,
and
the
stack
pointer
is
decremented.
Example:
This
example
shows
BASIC
preparing
to
return
from
a
SYS
command.
The
value
of
the
status
register
returned
from
the
user
routine
is
saved
in
$07F5.
.
A7CF
08
PHP
.
A7D0
8D
P2 07
STA
$07FS
.
A7D3
8E
F3
07
STX
$07F3
.
A7D6
8C F4
07
STY
$07F4
.
A7D9
68
PLA
Push
the
returned
status
onto
the
stack.
Save
the
returned
.A.
Save
the
returned
.X.
Save
the
returned
.Y.
Pull
the
returned
status
from
the
stack.

Other manuals for Commodore Plus 4

Related product manuals