Hardware Reference
In-Depth Information
The result is shown in Figure 2.12b.
Original value
New value
[$1000] = 11101101
C = 0
[$1000] = 11110110
C = 1
Figure 2.12b
■
Result of the asr $1000 instruction
▲
Example 2.20
▼
What are the new values of the memory location at $1000 and the C flag after executing the
instruction
lsr $1000
assuming that the memory location $1000 originally contains $E7 and the
C flag is 1?
Solution:
The operation of this instruction is illustrated in Figure 2.13a.
1
11
0
0
1
1
1
Memory location
$1000
C flag
0
0
1
1
1
0
0
1
1
1
Figure 2.13a
■
Operation of the lsr $1000 instruction
The result is shown in Figure 2.13b.
Original value
New value
[$1000] = 11100111
C = 1
[$1000] = 01110011
C = 1
Figure 2.13b
■
Execution result of lsr $1000
▲
Example 2.21
▼
What are the new values of accumulator B and the C flag after executing the
rolb
instruc-
tion assuming that the original value of B is $BD and the C flag is 1?
Solution:
The operation of this instruction is illustrated in Figure 2.14a.
Search WWH ::
Custom Search