0% found this document useful (0 votes)
7 views2 pages

sheet02 (1)

The document contains questions and exercises related to 8051 assembly language programming, including register operations, arithmetic instructions, and flag status after specific operations. It also includes activities for programming tasks such as moving values to registers and performing additions. Additionally, it discusses the behavior of the microcontroller upon power-up and the legality of certain MOV instructions.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

sheet02 (1)

The document contains questions and exercises related to 8051 assembly language programming, including register operations, arithmetic instructions, and flag status after specific operations. It also includes activities for programming tasks such as moving values to registers and performing additions. Additionally, it discusses the behavior of the microcontroller upon power-up and the legality of certain MOV instructions.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sheet (2) Assembly Language

1. name a 16 bit register in the 8051 ?

2. What is the result of the following code?

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

4. A programmer puts the first opcode at address 100H , what


happen when the microcontroller power up ?

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.

You might also like