Microprocessors AND Microcontrollers Lab ELE306L: Submitted By: Submitted To
Microprocessors AND Microcontrollers Lab ELE306L: Submitted By: Submitted To
Microprocessors AND Microcontrollers Lab ELE306L: Submitted By: Submitted To
AND
MICROCONTROLLERS LAB
ELE306L
8086 emulator is a microprocessor emulator with an integrated 8086 assembler. The emulator
can run programs on a virtual machine, and emulate real hardware including screen, memory
and input/output devices.
It helps in programming assembly language. The source code is compiled by assembler and
then executed on emulator step by step, allowing us to watch registers, flags and memory
while the program runs.
Registers help in speeding up the processor operations, the processor includes some internal
memory storage location called registers.
8086 processor has 8 general purpose registers:
1. AX: The accumulator register (AH/AL)
2. BX: The base address register (BH/BL)
3. CX: The count register (CH/CL)
4. DX: The data register (DH/DL)
5. SI: Source index register
6. DI: Destination index register
7. BP: Base pointer
8. SP: Stack pointer
There are 4 segment registers:
1. CS: Points at segment containing the current program.
2. DS: Generally, points at segment where variables are defined.
3. ES: Extra segment register, it is up to a coder to define its usage.
4. SS: Points at segment containing stack.
The segment registers work together with general purpose registers to access any memory
value.
Special purpose registers:
1. IP: Instruction Pointer- always works together with CS segment register and pints to
currently executing instruction.
2. Flag register: Determines the current state of microprocessor.
EXPERIMENT-1
Aim: To differentiate between formats of hexadecimal number beginning with alphabet and
number.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
data segment
ends
stack segment
ends
code segment
start:
; set segment registers:
MOV ax, 0FFFFh
MOV bx, 1234h
ENDS
end start
Output:
Aim: To demonstrate 16-bit addition by using 16-bit registers for each immediate value
an store it in user defined address.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
code segment:
start:
MOV ax,0FFFFh
MOV bx,2h
MOV ax,bx
MOV [1234h],ax
ENDS
end start
Output:
Aim: To demonstrate addition of two 16-bit numbers using the concept of four 8 bits registers.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
data segment
ends
stack segment
ends
code segment
start:
MOV al, 0Efh
MOV ah, 0ffh
MOV bl,2h
MOV bh,0h
ADD bl, al
ADD bh, ah
ENDS
end start
Output:
Aim: To demonstrate use of ROL and ROR with single time rotation.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
data segment
ends
stack segment
ends
code segment
start:
MOV ax, 5555h
ROL ax,1h
MOV bx,ax
ROR bx,1h
ENDS
end start
Output:
Aim: To demonstrate use of ROL and ROR with multiple times rotation using CL register.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
data segment
ends
stack segment
ends
code segment
start:
MOV ax, 1111h
MOV cl, 3h
ROL ax, CL
MOV bx, ax
ROR bx, CL
ENDS
end start
Output:
Aim: To demonstrate use of RCL and RCR instructions with single rotation.
Software required: Microprocessor Emulator 8086 (emu8086) with Integrated Assembler
Version 4.08
Program:
data segment
ends
stack segment
ends
code segment
start:
MOV ax, 0DDDDh
RCL ax, 1h
MOV bx, ax
RCR bx, 1h
ENDS
end start
Output:
EXPERIMENT-28
MOV CL, A1
MOV AX, 0001H
M:
MUL CL
LOOP M
STOSB
HLT
ENDS
END START
Output: