0% found this document useful (0 votes)
40 views9 pages

Microproccesor Lab Udita

The document discusses several examples of assembly code programs that can be written and run using the Emu8086 emulator software. It provides instructions on installing Emu8086 and then gives examples of assembly code to check a password, make a triangle pattern using asterisks, and convert between upper case and lower letters.

Uploaded by

alijaker017
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)
40 views9 pages

Microproccesor Lab Udita

The document discusses several examples of assembly code programs that can be written and run using the Emu8086 emulator software. It provides instructions on installing Emu8086 and then gives examples of assembly code to check a password, make a triangle pattern using asterisks, and convert between upper case and lower letters.

Uploaded by

alijaker017
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/ 9

Aim: Installation of the Emu8086 software.

Introduction:
Emu8086 is a popular emulator for the Intel 8086 microprocessor, which was the heart of the
original IBM PC and its clones. It allows developers and enthusiasts to write, run, and debug
8086 assembly language programs on modern computers. Emu8086 provides a simulated
environment where users can experiment with 8086 programming without needing physical
hardware. It's commonly used for learning assembly language programming, as well as for
retrocomputing enthusiasts who want to revisit or explore the early days of personal computing.

Software installation:

1. Open a Browser like-Google chrome\Firefox etc.


2. Search “emu8086 download”.
3. Select the required version.
4. Click on “Download for PC”.
5. After downloading, click on file and extract it on C-drive.
6. Now click on “Setup.exe” file.
7. Follow the instruction, click next and install.
8. After completing installation, the software is ready for run.

Result:
With this emulator, you can use your PC to run old software designed for computers from over 30
years ago. But its most interesting feature is that it has an assembler editor, so you can develop code
with it and then compile it. However, it has some limitations: some of the advanced hardware
features found in monitors and other components of these devices are not accessible.
Aim: Write an assembly code for checking password.

Introduction:
By using Emu8086, we can write an assembly code to set a password and compare with the
password given by the user. In this program, we have to make sure that the program have to
divide in two sections, one is for data and another is for code

Code:
.model small
.stack 100h
.data
a db 'Enter Your password $'
ok db 'Correct password $'
notok db ' Wrong Password
$' pass db 'Udita1234 $'
pass1 dw 8
.code
main proc
mov ax,@data
mov ds,ax
mov cx,pass1
mov bx,offset pass
mov ah,9
lea dx,a
int 21h
l1:
mov ah,8
int 21h
cmp al,[bx]
jne l2
inc bx
loop l1
mov ah,9
lea dx,ok
int 21h
jmp exit
l2:
mov ah,9
lea dx,notok
int 21h
exit:
mov ah,4ch
int 21h
main endp
end main
Input and Output:
Input- azmira1234

Output- Correct

password

Description:
When we will give a password in compiling data, the compiler check the data, is it matching
data in memory what we have saved or stored in data section. If the given data match with
stored data then the compiler execution shows us “Correct password” otherwise it shows
“wrong password”.
Aim: Write an assembly code for making ‘*’ triangle.

Introduction:
By using Emu8086, we can write an assembly code for making a triangle using “*”. In this
program, we have to use two loops.

Code:

;***
;**
;*
.model
.stack 100h
.code
main proc
mov cx,4
level1:
mov bx,cx
level2:
mov ah,2
mov dl, "*"
int 21h
loop level2
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
mov cx,bx
loop level1
exit:
mov ah,4ch
int 21h
main endp

Output: The output is given bellow:

****
***
**
*
Description:
By emulating the code, when we will run program, the compiler check the data and make a triangle
with star symbol as output compiler data.
Aim: Write an assembly code for lower case to upper case
alphabets.

Introduction:
By using Emu8086, we can write an assembly code to convert the alphabets from lower case to
upper case according to given input. In this program, we have to make sure that the program
has to divide into two sections, one is data and another one is for code section.

Code:
.model small
.stack 100h
.data
a db " lower case $"
b db " upper case $"
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
lea dx,a
int 21h
mov ah,1
int 21h
mov bl,al
mov ah,2
mov dl, 10
int 21h
mov dl,13
int 21h
mov ah,9
lea dx,b
int 21h
mov ah,2
sub bl,32; bl=bl-32
mov dl,bl
int 21h
main endp
end main

Input and Output:

Input: a

Output: A
Description:
By emulating the code, when we will run the program, the compiler take a input alphabet of lower
case and check to ASCII code section which already saved in the software, convert the alphabet to
upper case .
Aim: Write an assembly code to convert the alphabets from upper case
to lower case.
Introduction:

By using Emu8086, we can write an assembly code for converting the alphabets from
upper case to lower case. In this language, we have to make sure that the program have to divide in
two sections, one is data section and second is code section.

Code:

.model small
.stack 100h
.data
a db "upper case $ "
b db " lower case $ "
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
lea dx,a
int 21h
mov ah,1
int 21h
mov bl,al
mov ah,9
lea dx,b
int 21h
mov ah,2
add bl,32; bl=bl+32
mov dl,bl
int 21h
main endp
end main
Input and Output:

Input: A

Output: a
Description:
By emulating the code, when we will run the program, the compiler take a input alphabet of upper case
and check to ASCII code section which already save in the software, convert the alphabet to lower case
.

You might also like