0% found this document useful (0 votes)
24 views2 pages

Assembly Language Lab Guide for EMU8086

The document outlines a lab course on Microprocessors and Assembly Language at the Islamic University of Technology, focusing on program structure and arithmetic operations using EMU8086. It includes installation steps, data transfer instructions, arithmetic and logic instructions, and an example assembly language program structure. Additionally, it provides tasks for students to write assembly language codes for specific arithmetic operations.

Uploaded by

Sabit Bananee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Assembly Language Lab Guide for EMU8086

The document outlines a lab course on Microprocessors and Assembly Language at the Islamic University of Technology, focusing on program structure and arithmetic operations using EMU8086. It includes installation steps, data transfer instructions, arithmetic and logic instructions, and an example assembly language program structure. Additionally, it provides tasks for students to write assembly language codes for specific arithmetic operations.

Uploaded by

Sabit Bananee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Course Title: Microprocessors and Assembly Language Lab (CSE-4504)

Department of Computer Science and Engineering (CSE)


Islamic University of Technology (IUT), Gazipur

Lab # 01
Program Structure and Arithmetic Operations using Assembly Language Program in
EMU8086.

Objective:
Getting familiar with Program Structure and Arithmetic operations using Assembly Language
Program in EMU8086.

Installation of EMU8086 and Run for the First Time:


Step 1: Run the [Link] file to install the program.
Step 2: Launch the EMU8086 emulator. Choose “New” and specify “empty
workspace” template.
Step 3: Using the assembler editor, get familiar with the example codes.
Step 4: Start emulation by clicking the “emulate” button on the toolbar. A new
emulator window will appear.
Step 5: Debug the program codes by pressing the “single step” button on the toolbar
of the emulator window.
Step 6: Each time after pressing the “single step” button, check and record down the
contents of registers like AX, BX, CX, DX etc.
Theory:
 Data Transfer Instructions:
Format: MOV Destination, Source
Registers (Direct): Move contents of one register to another register
MOV AL, BL
MOV AX, BX
Immediate: Load a register with an immediate value or equivalent binary/hexa-decimal
MOV CL, 240
MOV CL, 11110000B
MOV CL, 00F0H
MOV CX, 256
MOV CX, 0000000100000000B
MOV CX, 0100H
Direct: Move contents of the variable named COUNT to a register
MOV DL, COUNT ; here COUNT is a 8-bit variable
MOV DX, COUNT ; here COUNT is a 16-bit variable
 Arithmetic / Logic Instructions:
Arithmetic and logic instructions can be performed on 8-bit (byte) and 16-bit values.
Increment the contents of a register by a value (decimal/binary/hexa-decimal)
ADD AX, 4
Add the contents of a register with the contents of another register
ADD AX, BX
Subtract a value (decimal/binary/hexa-decimal) from the contents of a register
SUB DL, 4
Subtract the contents of a register from the contents of another register
SUB DX, CX
Multiply AX by BX, the result will be in AX
MUL BX
Divide the contents of AX register with the value of CL and store the result in AX
DIV CL
Increase or Decrease the contents of BX register by 1
INC BX ; Increase DEC BX ; Decrease
Clear the contents of AX register
XOR AX, AX
Negation and NOT of a register value
NEG AL; 2’s Complement
NOT AL; 1’s Complement
Example for Assembly Language Program Structure:
ORG 0100h ; Offset of the program in memory

.DATA ; Data Segment Starts


A DB 11 ; Variable A got a BYTE value 11
B DW 500 ; Variable B got a WORD value 500
SUM DW ? ; Variable SUM is defined as a WORD variable without any value
DIFFERENCE DB ? ; Variable DIFFERENCE is defined as a WORD variable without any value
MULTIPLICATION DW ?
DIVISION DB ?
.CODE ; Code Segment Starts
MAIN PROC ; Initialize Data Segment Register
MOV AL, 30 ; Move decimal 30 to AL register
ADD AL, 15 ; Add decimal 15 to the content of AL and store the result in AL

MAIN ENDP ; End Procedure


END MAIN ; End MAIN
RET ; Return to DOS
Tasks to do:

1. Write appropriate assembly language codes to accomplish the following tasks (use as
many as possible arithmetic instructions with less number of registers):
 (30 + 15) * (575 – 225) + 210
 0Bh * (200 - 225) + 127
 0FFFh * 10h + 1111b
 Convert 260o C (Celsius) to F (Fahrenheit) using the following expression and
store in a variable F:
°F = °C x 10/5 + 32 - 1

You might also like