HEAVEN’S LIGHT IS OUR GUIDE
RAJSHAHI UNIVERSITY of ENGINEERING &
TECHNOLOGY
Experiment No.: 01
Experiment Name: Study of MDA-8086 Trainer
Course No.: EEE 3209
Course Title: Microprocessor, Interfacing & System Design Sessional
Submitted by: Submitted to:
Name: Md. Tofayel Alam Md. Ilias Rahman
Roll: 1901041 Assistant professor, dept. of EEE,
Dept.: EEE RUET, Rajshahi .
Section: A
Date of submission:
Exp. No.: 01
Exp. Name: Study of MDA-8086 Trainer
Objective: (a) Perform addition & subtraction using MDA-8086 Trainer
Theory: The Intel 8086 microprocessor is a 16-bit microprocessor that was introduced by Intel in the late
1970s. It played a significant role in the history of microprocessors and had a profound impact on computer
architecture. Here are some basic insights of it-
1. Architecture: The 8086 is a 16-bit microprocessor with a 16-bit data bus, which means it can process data
in 16-bit chunks. It also has a 20-bit address bus, allowing it to access up to 1 MB of memory. This
architecture offered improved performance and memory addressing capabilities compared to its 8-bit
predecessors.
2. Registers: The 8086 features various registers, including four general-purpose registers (AX, BX, CX,
DX), each of which can be split into two 8-bit registers (e.g., AH and AL for AX). These registers are used
for data manipulation. Additionally, there are index registers (SI and DI), segment registers (CS, DS, ES, and
4. Memory Segmentation: One unique aspect of the 8086 architecture is memory segmentation. Memory is
divided into segments, each 64 KB in size, and segment registers (e.g., CS for Code Segment, DS for Data
Segment) point to the base address of these segments. Memory addresses are calculated by combining an
offset within a segment with the base address, offering flexibility in memory access.
5. Addressing Modes: The 8086 supports various addressing modes, allowing for flexibility in data
manipulation. These include direct addressing (accessing memory directly), register addressing (using data
stored in registers), immediate addressing (working with constants), and indexed addressing (using an offset
based on an index register(SS), and a flags register (FLAGS) that stores status flags indicating various
conditions after operations.
Performing addition & subtraction by 8086 microprocessor:
Addition:
(1) Load Values: To perform addition, need to load the values wanted to add into the appropriate registers.
Common choices are used AX, BX, CX, DX registers for temporary usage.
(2) Perform Addition: The ADD instruction is used to add the values in two registers.
(3) Handle Carry: If the addition results in a carry out of the most significant bit (bit 15 in a 16-bit
addition), need to account for it in subsequent calculations, especially in performing multi-word arithmetic.
Subtraction:
(1) Load Values: To perform subtraction, need to load the values wanted to add into the appropriate
registers. Common choices are used AX, BX, CX, DX registers for temporary usage.
(2) Perform subtraction: The SUB instruction is used to subtract the value in the source register from the
value in the destination register.
(3) Handle Borrow: If the subtraction requires borrow (i.e., if the source value is greater than the destination
value), need to account for it in subsequent calculations.
Fig.1.1. MDA-8086 Trainer
Assembly Code:
Addition: Perform addition of two hexadecimal numbers: 1233h and 1897h
ORG 100h ; Start of the program
MOV AX, 1233h ; Load the first hexadecimal number (1233h) into AX
MOV BX, 1897h ; Load the second hexadecimal number (1897h) into BX
ADD AX, BX ; Add the value in BX to AX
; AX now contains the result of the addition (1233h + 1897h)
INT 20h ; Terminate the program
RET ; Return from the program
Subtraction: Perform subtraction of two hexadecimal numbers: 1233h and 1897h
ORG 100h ; Start of the program
MOV AX, 1233h ; Load the first hexadecimal number (1233h) into AX
MOV BX, 1897h ; Load the second hexadecimal number (1897h) into BX
SUB AX, BX ; Subtract the value in BX from AX
; AX now contains the result of the subtraction (1233h - 1897h)
INT 20h ; Terminate the program
RET ; Return from the program
Result:
Machine code
Addition:
1233h 1897h 1233h+1897h
B8 BB 03
33 97 C3
12 18
Subtraction:
1233h 1897h 1233h-1897h
B8 BB 2B
33 97 C3
12 18
Discussion & conclusion: The overall addition and subtraction operation was performed by using emulator
software and an MDA-8086 Trainer in the lab. The machine codes for each numbers were obtained first
using emulator & that was used for the Trainer. From the result it was found that that result obtained from
the Trainer was absolutely correct.