EMAC PRIMER Instruction Manual page 58

Table of Contents

Advertisement

ADDRESS
FFC7
PC->
FFC8
FFC9
FFCA
FFCB
FFCC
FFCD
FFCE
FFCF
FFD0
FFD1
SP->
FFD2
FFD3
FFD4
7) Execute the PUSH B instruction by single stepping once.
8) If you examine the SP then you will find that it is now FFD0 which is 2 less than before and the stack contents
will be 0304 which is the value pushed on the stack by the PUSH B instruction.
9) By examining the memory from FFD0 to FFD4 you will see that the data is as the listing below. Return PC to
the value of FFCD.
ADDRESS
FFC7
FFC8
PC->
FFC9
FFCA
FFCB
FFCC
FFCD
FFCE
FFCF
SP->
FFD0
FFD1
FFD2
FFD3
FFD4
10) Single step the POP PSW and observe that SP = FFD2 which is now 2 more than before, then examine the
A.F. register (A register and flag register) and you will see that it is now the value that was put on the stack by the
PUSH B instruction.
11) Single step the POP B and you will see that SP is back to the value that it had at the beginning of the program
(FFD4) and that the BC register pair is now the value which was pushed on the stack with the PUSH PSW
instruction.
ADDRESS
FFC7
FFC8
FFC9
FFCA
PC->
FFCB
FFCC
FFCD
FFCE
FFCF
FFD0
FFD1
FFD2
FFD3
SP->
FFD4
Note: The "undefined values" shown in the machine language listing are values that MOS PUSHes and POPs
from the stack on each breakpoint or single step. This is done without affecting the important values that your
program stores on the stack, but this does affect the unused stack memory. So, though MOS returns with the
DATA
DESCRIPTION
F5
PUSH
C5
PUSH
F1
POP
C1
POP
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
02
value from flags
01
value from register A
00
DATA
DESCRIPTION
F5
PUSH
C5
PUSH
F1
POP
C1
POP
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
04
value from register C
03
value from register B
02
value from flags
01
value from register A
00
DATA
DESCRIPTION
F5
PUSH
C5
PUSH
F1
POP
C1
POP
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
XX
(undefined value)
00
PSW
B
PSW
B
PSW
B
PSW
B
PSW
B
PSW
B
58
(See note below)
(See note below)
(See note below)

Advertisement

Table of Contents
loading

Table of Contents