0% found this document useful (0 votes)
91 views

Lab 1

The document provides instructions for an experiment using the emulator8086 software to run assembly language programs, including downloading and running example programs, writing new programs, and verifying output; it includes an example program that copies the value from one data variable to another to demonstrate the MOV instruction.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Lab 1

The document provides instructions for an experiment using the emulator8086 software to run assembly language programs, including downloading and running example programs, writing new programs, and verifying output; it includes an example program that copies the value from one data variable to another to demonstrate the MOV instruction.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Daffodil International University

Department of Electrical and Electronic Engineering


EEE 324: Microprocessors and Interfacing Laboratory

EXPERIMENT NO: 01

NAME OF THE EXPERIMENT: INTRODUCTION TO EMULATOR8086

Objectives: The objectives of the experiment are-


1. To know how to run a program in emulator8086
2. To know how to copy data
APPARATUS:

1. PC with Windows XP.


2. emulator8086 Software.
THEORY:

There are four fields in an instruction:


 Label
 Op-code (Operation code )
 Operands
 Comments
Example: xxx: MOV CX, DX; Copy

PROCEDURE:

 To run an example code follow the following steps-

1. First of all you need to start emu8086. Double click emu8086 icon or run
c:\emu8086\emu8086.exe
If you don't have this program yet, you can download it from http://www.emu8086.com/

2. When it starts, click code examples and select Hello, world.

3. A code example with a lot of comments should open, all comments are green and they take
about 90% of all text, so don't be scared by this tiny "Hello Word" code. The compiled
executable has length of just about 100 bytes, this is even less than the size of this sentence.

4. To run this example in the emulator click emulate (or press F5). This makes the assembler to
try to assemble and save the executable to c:\emu8086\MyBuild and then, if assembler
succeeds making the file, the emulator will automatically load it into the memory.
5. You can click single step (or press F8) to executed the code and see how it works, you can also
click step back (or press F6) and see how changes are reversed.

6. Actually, there are far more than a single way to print "Hello World" in assembly language,
and this is not the shortest way. Click examples and browse c:\emu8086\examples, there is
HelloWorld.asm that is assembled in only 30 bytes, it is so small because, unlike the previous
example that does everything itself, the shorter one uses built-in interrupt function of the
operating system. Interrupts save a lot of work and time, but unlike the previous example, they
often do not let you see how they do what they do.

 To write a new code follow the following steps-

1. Start emulator8086.
2. To write a new code click on New and choose code template as empty workspace.
3. Write the code in the text area.
4. Click on File\Save and save it.
5. Click on Compile\Save\Run. After the operation is completed the emulator will display a
message.
6. Click on debug and verify the output on debug log.

Program 01:

Write the following code in the text area and verify the output.

.MODEL SMALL
.STACK 100H
.DATA

DATA1 DW 1223H
DATA2 DW ?

.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX

MOV AX, DATA1


MOV DATA2,AX

HLT
MAIN ENDP
END MAIN
REPORT:

1. Describe how to write a new program in emulator8086.


2. Write down a code for adding two numbers 0124H and 1254H

You might also like