Microprocessor Lab1
Microprocessor Lab1
Microprocessor Lab1
Emu8086 combines an advanced source editor, assembler, disassemble and software emulator
(Virtual PC) with debugger. It compiles the source code and executes it on emulator step by step.
Visual interface is very easy to work with. You can watch registers, flags and memory while your
program executes. Arithmetic & Logical Unit (ALU) shows the internal work of the central
processor unit (CPU). Emulator runs programs on a Virtual PC, this completely blocks your
program from accessing real hardware, such as hard-drives and memory, since your assembly code
runs on a virtual machine, this makes debugging much easier. 8086 machine code is fully
compatible with all next generations of Intel's microprocessors, including Pentium II and Pentium
4. This makes 8086 code very portable, since it runs both on ancient and on the modern computer
systems. Another advantage of 8086 instruction set is that it is much smaller, and thus easier to
learn.
Variable is a memory location. For a programmer it is much easier to have some value be kept in
a variable named "var1" then at the address 5A73:235B, especially when you have 10 or more
variables. Our compiler supports two types of variables: BYTE and WORD.
1 of 3 | P a g e
8086 Microprocessors Lab 1
last row is an ASCII character value. Compiler is not case sensitive, so "VAR1" and "var1" refer to
the same variable.
2.2 Compiler directive: ORG 100h
It tells compiler that the executable file will be loaded at the offset of 100h (256 bytes), so compiler
should calculate the correct address for all variables when it replaces the variable names with their
offsets. Directives are never converted to any real machine code.
2 of 3 | P a g e
8086 Microprocessors Lab 1
5. Write an 8086 assembly program that clears the value stored in CX using XOR
6. Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6
of the AX register.
7. Write a program that adds two words in memory locations and stores the result in
subsequent memory location.
8. Write a program in 8086 microprocessors to multiply two 8-bit numbers, where numbers
are stored from offset 500 and store the result into offset 600
9. Write a program to execute the following statement CL=(2*AL+BL)/Dl.
10. Write a program that set Carry, Overflow, Direction and Trap flags, clear parity, sign and
zero flags, and invert Interrupt and Auxiliary carry flags of the flag register. Don’t use set
and clear instructions.
11. Write a program in 8086 microprocessor to find out the subtraction of corresponding
elements of two arrays of 8-bit n numbers, where size “n” is stored at offset 500 and the
numbers of first array are stored from offset 501 and the numbers of second array are
stored from offset 601 and store the result numbers into first array i.e offset 501
12. Write a program that counts up from 0 to 99 in BCD. Store the ODD numbers starting at
4100H.
N.B: You have to submit a lab report through E-learning in groups of three students.
3 of 3 | P a g e