sheet02 (1)
sheet02 (1)
MOV A , #15H
MOV R2, #13H
ADD A , R2
3. Which of the following is illegal and why?
A) MOV R3, #500 B) MOV R1, #50 C) MOV R7, #00
D) MOV A, #255H E) MOV A, #50H F) MOV A , #F5H
G) MOV R9, 50H
5. Show the status of the CY, AC and P flag after the addition of 9CH and
64H in the following instructions.
MOV A, #9CH
ADD A, #64H
Solution:
9C 10011100
+ 64 01100100
100 00000000
CY = 1 since there is a carry beyond the D7 bit
AC = 1 since there is a carry from the D3 to the D4 bi
P = 0 since the accumulator has an even number of 1s (it has zero
1s)
6. Show the status of the CY, AC and P flag after the addition of 88H and
93H in the following instructions
MOV A, #88H
ADD A, #93H
7. write a simple program in which the value 55H is added 5 times?
8. show the stack and stack pointer for each line of the following
program
ORG 0
MOV R0, #66H
MOV R3,#7FH
MOV R7,#5DH
PUSH 0
PUSH 3
PUSH 7
CLR A
MOV R3,A
MOV R7,A
POP 3
POP 7
POP 0
ACTIVITY 1
Write and assemble a program to move value 99H to register A. Then
from register A move it to all registers R0 - R7. Use the simulator to
single-step the program and examine the registers.
ACTIVITY 2
Write and assemble a program to add all the single digits of your ID
number and save the result in R2. Pick 7 random numbers (all single
digit) if you do not want to use your ID number. Then use the simulator
to single-step the program and examine the registers.