Solution For HW#2: H/W Summary (20 Points) : ECE473/ECE573, Microprocessor System Design
Solution For HW#2: H/W Summary (20 Points) : ECE473/ECE573, Microprocessor System Design
1. What is the state of the P bit in the PSW after execution of each of the following
instructions? (3 points)
(a) CLR A
(b) MOV A, #03H
(c) MOV A, #0ABH
<Sol>
(a) A=0000 0000B P=0
(b) A=0000 0011B P=0
(c) A=1010 1011B P=1
2. What bit addresses are set to 1 as a result of the following instructions? (5 points)
<Sol>
(a) MOV 26H, #26H
The data of 0010 0110B is copied to the byte address of 26 in the RAM. The bit
addresses in this address are (37,36,35,34,33,32,31,30).
Therefore, the bit addresses are set to 1 are 35, 32, and 31.
3. Identify the bit position and byte address for each of the following instructions. (3
points)
<Sol>
(a) SETB 0A8H
Bit address of A8 is located in IE register. The byte address for IE is A8H.
4. What is the bit address of the most-significant bit (bit 7) at byte address 25H in the
8051s internal data memory (RAM)? (2 points)
<Sol>
The bit address is 2FH.
5. What is the active register bank after execution of each of the following instructions?
(3 points)
<Sol>
(a) MOV PSW, #0C8H
1100 1000B is loaded to PSW register. RS1=0, and RS0=1 Register Bank 1
6. What instruction sequence could be used to copy the content of R7 to external RAM
location 100H? (2 points)
<Sol>
MOV DPTR, #100H
MOV @DPTR, R7
7. What registers in SFR (RAM) are bit-addressable registers and what are their byte
addresses? (2 points)
<Sol>
There are 11 bit addressable registers such as B, ACC, PSW, IP, P3, IE, P2, SCON,
P1, TCON, and P0. The addresses for them are F0, E0, D0, B8, B0, A8, A0, 98, 90,
88, and 80 respectively.