Simple Sample Question 8085 instruction



Do yourself      

1)      write a program to move data from register B to C,C to D and D to E.

MOV        C,B   ; moves data from register B to C
MOV        D,C    ;moves data from register C to D
MOV        D,E     ; moves data from register ram D to E
HLT                     ;stops the program

Output :
Let register B contains data 20h
B: 20h   C: 20h
D: 20h   E:  20h


2)      Write a program to store 20h in address 4040.
1st  method
LXI      H, 4030h      ; stores 4030h in HL register pair
MVI     B,20h          ; stores 20h to register B
MOV   M,B             ; moves content of register B to memory location 4040
HLT

2Nd method
MVI   A, 20h
STA    4040h
HLT

Output
B: 20         C: J J
H:40            L:30
[4040] : 20
Write a program to store the data 40H and 20H to the address 5051 and 5052 respectively.
Method 1

LXI      H, 5051h     ; Loads 5051 to HL pair
MVI    M, 40h         ; moves the data 40 h to memory location pointed by HL i.e.5051
LXI      H, 5052h     ; Loads address location 5051 to HL pair
MOV   M,20h          ; moves the data 40 h to memory location pointed by HL ie,5051
HLT                         ; stops the program

Method 2

MVI   A, 40H      ; Moves data 40H to the accumulator
STA    5051H      ; Loads the content of accumulator content to address 5051
MVI    A, 20H     ; Moves data 20H Accumulator
STA    5052H      ; Loads the content of accumulator content to address 5052
HLT

Output
[5051] : 40
[5052] : 20

2) Write the program to store the data from the memory location 2051 and 2052 to register B and C respectively.
(Before doing this program in simulator load data in memory location 2051 and 2052 yourself)
Method 1

LDA     2051H      ; load the content of address 2051 to the accumulator
MOV   B,A           ; Moves the data from Acc.  Register to B
LDA    2052H       ; load the content of address 2051 to the accumulator
MOV   C,A           ; Moves the data from Acc. to register C
HLT


No comments:

Post a Comment

its cool