Lab 1 - Introduction To 8086 Microprocessor Emulator
Lab 1 - Introduction To 8086 Microprocessor Emulator
Objective:
Introduction to Microprocessors and Microcontrollers and working environment of EMU 8086
(Microprocessor Emulator).
Introduction:
A microprocessor is also known as computer processor which incorporates the functions of a
computer's central processing unit (CPU) on a single integrated circuit (IC) or at most a few
integrated circuits. The microprocessor is a multipurpose, clock driven, register based, digital-
integrated circuit which accepts binary data as input, processes it according to instructions stored
in its memory, and provides results as output. Microprocessors contain both combinational logic
and sequential digital logic. Microprocessors operate on numbers and symbols represented in
the binary numeral system.
Microprocessors touch almost every aspect of modern life. They can be found in vehicles,
consumer electronics, communications devices, appliances, toys and of course computers. With
the exception of full computers (i.e. desktop or full laptops) which use full microprocessors with
separate memory and peripherals (device used to put information into and get information out
of the computer).
8085 does not support 8086 supports pipeline 8088 supports pipeline
pipeline architecture architecture architecture
8085 has no pre-fetch queue 8086 has a 6 byte pre-fetch 8088 has a 4 byte pre-fetch
as it does not support queue for pipelining queue for pipelining
pipelining
8085 has an IO/ pin to 8086 has an M/ pin to 8088 has an IO/ pin to
differentiate between differentiate between differentiate between
memory and I/O operations memory and I/O operations memory and I/O operations
8085 has no pre-fetch queue 8086 BIU will fetch new bytes 8088 BIU will fetch a new
into the pipelining queue byte into the pipelining
when 2 bytes of the queue queue when 1 byte of the
are empty queue is empty
8085 has 5 flags 8086 has 9 flags 8088 has 9 flags
The four data registers labeled AX, BX, CX and DX may be further subdivided for 8-bit operations
into a high-byte or low-byte register, depending where the byte is to be stored in the register.
Thus, for byte operations, the registers may be individually addressed. So, each of these is 16 bits
wide but can be accessed as a byte or a word.
From here, you can create a new project with following options;
This screen allows you select what kind of file you want create- either a bin file with .com
extension, an executive file with .exe extension, a pure binary file or a boot file. Once you select
the type the emu8086 opens the editor with a readymade template of the kind of file you wanted
to create.
Consider that you selected .exe template then the editor opens with default template as
shown below
Now, you can write the code in the “add your code here” section, change the code, data segment
part and define constant or variables.
If you select cancel in the above default template selection then it opens just the blank
editor as shown below
Example:
mov ax, 10
add ax, 21
inc ax
dec ax
sub ax, 12
add ax, 7
inc ax
dec ax
sub ax, 20
Once you have typed in your program you should save the program by going to File Save or
File>save as or just by clicking the save button on the toolbar. Emu8086 will save it the newly
created file with .asm extension in it's default location (C:\emu8086\MySource) but you can
browse to a folder where you want to save the file.
Once you have saved the file, you can emulate the program by clicking on the emulate button on
the toolbar to see the behavior of the program. That is what register has what content, the flag
resisters that gets effected by the program and so on. The screenshot below shows this process.
From this emulator window we can just run the program or go through the program step by step
by clicking on the single step button.
For the example program above when we step through the program we can see the content of
the accumulator and how it gets modified and what new values are stored. Not only can we know
the content of the accumulator but also the other registers, the stack and the flag register.
Lab Tasks
Task 1:
Write the following code in emulator and examine the contents of registers by single stepping
MOV AL, 57
MOV DH, 69
MOV DL, 72
MOV BX, DX
MOV BH, AL
MOV BL, 9FH
MOV AH, 20
ADD AX, DX
ADD CX, BX
ADD AX, 1F35H
Task 2:
Write a program to subtract the content of register DX from the content of register AX, then add
the result to the content of CX. Set the registers to 4, 0A and 1F respectively.