Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

*********

LAB 3
*********

______________________________________________________________________

1.Write a program to AND the content of reg B and content of memory at


9030. Assume the content of 9030 as 34 and reg B as 92.

LDA 9030H
MVI B,92H
ANA B
HLT
______________________________________________________________________

______________________________________________________________________

2.Write a program that will check whether D4 bit of data at address


9030 is zero. Just check the result after the operation.

LDA 9030H
ANI 10H ;if D4 is zero, zero flag(Z) will be raised by this instruction
HLT
______________________________________________________________________

______________________________________________________________________

3.Write a program to OR the content of memory 9024--A2


location 9024 with the memory location 9025 9025--79
and store the result at 9026. 9026--

LHLD 9024H
MOV A,H
ORA L
STA 9026H
HLT
______________________________________________________________________

______________________________________________________________________

4.Write a program to XOR the content 9027--4B


of 9027 with the location 9028 and 9028--C4
store the content at 9029. 9029--

LHLD 9027H
MOV A,L
XRA H
STA 9029H
HLT
______________________________________________________________________

______________________________________________________________________
5.Logical instructions can also be used to mask certain bits of a word
Write a program to complement bit D6 of data at memory location 9025.
Assume data in 9025 is 79.

LDA 9025H
XRI 40H ;D6 is complemented by this instruction while all other
STA 9025H ;bits remain unchanged
HLT
______________________________________________________________________

______________________________________________________________________
6.We can complement the accumulator content by using instruction other
than CMA How is that possible? Write a program to illustrate this.

MVI A, 0F0h
XRI 0FFH ;complements the acc. content to 0Fh.
HLT
______________________________________________________________________

______________________________________________________________________
7.Write a program to compare the content of the memory 8081--36
location 8081 and 8082. Subtract the memory content at 8082--A4
8082 from 8081 and see whether the flag content is same 8083--
as the compare instruction or not.

a)
LHLD 8081H
MOV A,L
CMP H
HLT

b)
LHLD 8081H
MOV A,L
SUB H
HLT
______________________________________________________________________

______________________________________________________________________
8.Write a program to check the bit D5 of the content of memory at
9025. Display 1 at port A if the bit is 1 else displays nothing. Use
the rotating instructions after masking. Use the rotating instruction
which uses less no of instructions.

LDA 9025H
ANI 20H
JNZ L2
HLT
L2: RLC
RLC
RLC
OUT 0AH
L1: HLT
______________________________________________________________________

______________________________________________________________________
9.Change the program in assignment 8 to display 80H if the bit is 1
else nothing.

LDA 9025H
ANI 20H
JNZ L2
HLT
L2: RLC
RLC
OUT 0AH
L1: HLT
______________________________________________________________________

You might also like