Lab 1
Lab 1
EXPERIMENT NO: 01
PROCEDURE:
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/
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.
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
HLT
MAIN ENDP
END MAIN
REPORT: