Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Find the value of the C, DC and Z flags after the execution of the following

ID: 1714916 • Letter: 1

Question

1. Find the value of the C, DC and Z flags after the execution of the following code.

MOVLW 0x85

ADDLW 0x9F

2. Find the value of the C, DC and Z flags after the execution of the following code.

MOV LW 0x99

ADDLW 0x67

ADDLW 0xFF

3. Find the value of the C, DC and Z flags after the execution of the following code.

MOVLW 0xAA

ADDLW 0x55

4. Find the value of the C, DC and Z flags after the execution of the following code.

MOVLW 0xFE

ADDLW 0x1

ADDLW 0x1

5. Upon reset, what is the value in the PC register?

6. Give the address of WREG register.

Explanation / Answer

C -> 8th bit Overflow
DC -> 4th bit Overflow

1:

C=0

DC=1

Z=0

2:

Z=0

C=1

DC=1

3.

C=1

DC=1

Z=0

4.

C=0

DC=1

Z=0

5.

00000