Microprocessor Lab
KCS-452
DEPARTMENT OF COMPUTER SCIENCE
AND ENGINEERING
INSTITUTE OF ENGINEERING AND
TECHNOLOGY, LUCKNOW
Submitted By - Submitted To:
Jagesh Soni Deepali Ma’am
CSE 2nd Year
Roll No - 1805210023
1. Write an assembly language program to load the
numbers in register D and C, now increment the content
of register C then add the content of register C and D
and the sum at output PORT1.
MVI C, 65H
MVI D, 91H
INR C
MOV A, C
ADD D
OUT PORT1
HLT
2. Write an assembly language program using the ADI
instruction to add the two hexadecimal numbers 3AH
and 48H and to display the answer at the output port.
MVI B, 3AH
MOV A, B
MVI C, 00H
ADI 48H
JNC FLAG
INR C
FLAG: STA 2052
MOV A, C
STA 2053
OUT 01H
2
HLT
3AH
+48H
= 00 82H
// 2052: 82H
// 2053: 00H
3. Write an assembly language program to clear the
accumulator then add 47H using the ADI instruction,
now subtract 92H and display the result.
SUB A
ADI 47H
SUB 92H
OUT PORT1
HLT
4. Write an assembly language program to load the data
byte A8H in register C. Mask the +high order bits(D7-
3
D4) and display the low order bits(D3-D0+) at an output
port.
MVI C, A8H
MOV A, C
ANI 0FH
OUT PORT0
HLT
5. Write an assembly language program to clear the
carry flag CY, then load number FFH in register B and
increment (B). If carry flag is set, display 01 at the output
port otherwise display the content of register B.
Instruction Comment Operation
STC Set Carry Flag Cy= 1
CMC Clear Carry flag Cy= 0
MVI B, FFH Load number FFH in register B B= FFH
INR B Increment register B B= 00H
JC Disp 1 Jump if carry to display routine to
display 01 at output port
CALL display Call display routine for displaying
contents of register C
HLT Terminate program execution Stop
6. Write an assembly language program to print 1’s
complement of an 8-bit number.
include “emu8086.inc”
ORG 100h
4
MOV AL, 05H
NOT AL
INC AL
CALL PRINT_NUM
RET
DEFINE_PRINT_NUM
END
7. Write an assembly language program to multiply two
8-bit unsigned numbers.
include “emu8086.inc”
ORG 100h
MOV AL, 04H
MOV BL, 02H
MUL BL
CALL PRINT_NUM
RET
DEFINE_PRINT_NUM
END
8. Write an assembly language program in 8086
microprocessor to reverse 16 bit number using 8 bit
operation. (use ROL instruction)
MOV AL, [2050]
MOV AH, [2051]
MOV CX, 0004
ROL AL, CX
5
ROL AH, CX
MOV [2050], AH
MOV [2051], AL
HLT