Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

3.1 Experiment No.:03 3.2 Experiment Name: Experimental Study of 8 Bit Subtraction, Multiplication, and Division and Get

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

3.1 Experiment no.

:03

3.2 Experiment name: Experimental Study of 8 bit Subtraction, Multiplication, and Division and get
familiar with MASM using EMU- 8086 Software

3.3 Objectives:

1. To know about how to multiply 8bit data using EMU-8086 Software


2. To know about how the division works for 8bit data using EMU-8086 Software
3. To know about how to subtract 8bit data using EMU-8086 Software
4. To get familiar with M emulator/MASM

3.4 Theory:

In 8086 microprocessor four general purpose registers (AX, BX, CX, DX) are being used to perform
different arithmetic and logic operations.

Within the microprocessor multiplication of two registers will be executed, where


AX is called the destination operand and BX /CX/DX is called the source operand.
Here one operand needs to place in AX register, and the other have to place in
BX/CX/DX register. The result of the multiplication will store in the AX registers
and it is being predefined in the EMU-8086 Kit. To perform multiplication MUL
command is used.
Example: MUL (source)

Likewise multiplication, division between two registers will be executed within


the microprocessor. Among two multiplication operand ,one operand must be
placed in the AX register(is called destination operand) and the other one needs
to place in BX /CX/DX register( is called the source operand). The result of division
will store in the AX registers and the reminder will store in the DX register and it is
also predefined in the EMU-8086 kit. To perform division DIV command is used.
Example: DIV (source)

Subtraction between registers can also be held with proper instruction and that is
SUB AX, BX.
For borrow operation we use opcode SBB. Example: SBB AX, BX.

The Microsoft Macro Assembler (MASM) is an x86 assembler that uses the Intel
syntax for MS-DOS and Microsoft Windows. Beginning with MASM 8.0, there are
two versions of the assembler: One for 16-bit & 32-bit assembly sources, and
another (ML64) for 64-bit sources only.

3.5 Required Apparatus :

2. A computer with Emulator software (emu 8086)

3.6 Procedure

1. First, the EMU-8086 software was opened on the computer.


2. The data were then coded using assembly language for division,
multiplication and subtraction that is showing in the figure 3.3, figure 3.4
and figure 3.5.
3. We observed the result from the emulator software and recorded the data.
4. After completing these tasks, the square shape was created with asterisk using MSAM

3.7 Program

3.7.1 Multiplication:

MOV AL, 12H

MOV CL, 2FH

MUL CX

3.7.2 Division

MOV AL, 24H

MOV CL, 10H

DIV CX

3.7.3 Subtraction

MOV AL, 8FH

MOV CL, 9FH

SBB AX,CX
3.8 Table :

3.8.1 Multiplication Table:

Assembly Machine Code Output


Language
MOV AL, 12H B0 24
MOV CL, 2FH B1 2F AX= 034EH
MUL CX F7 E1

Fig.3.1 EMU-8086 output multiplication

3.8.2 Division Table:

Assembly Machine Code Output


Language
MOV AL, 24H B0 24
MOV CL, 10H B1 10 AX= 0002H
DX=0004H
MUL CX F7 F1

Fig.3.2 EMU-8086 output division

3.8.3 Subtraction Table:

Assembly Machine Code Output


Language
MOV AL, 8FH B0 8F
MOV CL, 9FH B1 9F AX= FFF0H
MUL AX,CX 1B C1

Fig.3.3 EMU-8086 output subtraction


Figure 3.3: 8bit Multiplication using Figure 3.4: 8bit Division using
EMU-8086 Software EMU-8086 Software

Figure 3.5: 8bit Subtraction using EMU-8086 Software


3.9 Program Using M emulator/ MASM:

Here we need to print a square asterisk using machine code:

Code & Results:

Figure 3.6: MASM using EMU-8086 Software

3.10 Discussion & Conclusion:

The experiment have been about the study of 8 bit division, multiplication, subtraction using EMU-8086
software. The registers of 8086 are 16 bit. For the subtraction SBB instructions have been used to
calculate with carry. The machine code that has been found in the emulator software, and recorded in
the table(3.8). This experiment has been successfully completed. Using MASM a square asterisk is
printed in EMU-8086 software shown in the figure 3.6. To perform this task nested loop is used inside
the assembly languages. The output shown in the figure executed perfectly.
Rajshahi University of Engineering
& Technology (RUET)

Course name: Microprocessor, Interfacing and System Design Sessional


Course no: EEE 3210

Date of experiment: 25-01-2020


Date of submission: 03-02-2020

Experiment no: 03
Name of the experiment: Experimental Study of 8 bit Subtraction, Multiplication,
Division, using EMU- 8086 Software and get familiar with MASM using EMU- 8086
Software

Submitted by-
Name: Afser Jani Rabby
Roll no: 1601042
Section: A
Session: 2016-2017

You might also like