Hardware Reference
In-Depth Information
Example 2.18
What are the values of accumulator A and the C flag after executing the asla instruction
assuming that originally A contains $95 and the C flag is 1?
Solution: The operation of this instruction is shown in Figure 2.11a.
C flag
Accumulator A
1
00
1
0
1
0
1
0
00
1
0
1
0
1
0
1
Figure 2.11a Operation of the asla instruction
The result is shown in Figure 2.11b.
Original Value
New Value
[A] = 10010101
C = 1
[A] = 00101010
C = 1
Figure 2.11b Execution result of the asla instruction
Example 2.19
What are the new values of the memory location at $1000 and the C flag after executing the
instruction asr $1000 ? Assume that the memory location $1000 originally contains the value of
$ED and the C flag is 0.
Solution: The operation of this instruction is shown in Figure 2.12a.
1
11
0
1
1
0
1
C flag
Memory location
$1000
11
1
1
0
1
1
0
1
Figure 2.12a Operation of the asr $1000 instruction
Search WWH ::




Custom Search