100% found this document useful (1 vote)
571 views6 pages

Microprocessor Lab KCS-452

This document contains 8 programming problems to be solved in assembly language for the 8086 microprocessor. The problems involve tasks like loading values into registers, performing arithmetic operations like addition and subtraction, manipulating bits, reversing numbers, and multiplying numbers. Sample code is provided as a solution for some of the problems to demonstrate how to complete the requested operations in assembly language.

Uploaded by

Jagesh Soni
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
100% found this document useful (1 vote)
571 views6 pages

Microprocessor Lab KCS-452

This document contains 8 programming problems to be solved in assembly language for the 8086 microprocessor. The problems involve tasks like loading values into registers, performing arithmetic operations like addition and subtraction, manipulating bits, reversing numbers, and multiplying numbers. Sample code is provided as a solution for some of the problems to demonstrate how to complete the requested operations in assembly language.

Uploaded by

Jagesh Soni
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/ 6

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

You might also like