0% found this document useful (0 votes)
321 views3 pages

02 Lab Manual - Program Using Macro

This document provides instructions for a lab experiment on writing an 8086 assembly language program using macros to display personal information. The objectives are to study macros and apply the concept of macros in a program. It describes macros, required interrupt and main instructions, and provides a program template. The in-lab task is to execute a program following the given algorithm to define a display macro, declare messages, call the macro to display them, and terminate the program. The expected output and post-lab outcomes are also included along with reference books and questions for a viva.

Uploaded by

prince-karan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
321 views3 pages

02 Lab Manual - Program Using Macro

This document provides instructions for a lab experiment on writing an 8086 assembly language program using macros to display personal information. The objectives are to study macros and apply the concept of macros in a program. It describes macros, required interrupt and main instructions, and provides a program template. The in-lab task is to execute a program following the given algorithm to define a display macro, declare messages, call the macro to display them, and terminate the program. The expected output and post-lab outcomes are also included along with reference books and questions for a viva.

Uploaded by

prince-karan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

SSBTs College of Engineering & Technology, Bambhori, Jalgaon

Department of Computer Engineering


Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _Date of Performance: _ _ /_ _/20_ _
Class: S.E. Computer
Date of Completion: _ _ /_ _/20_ _
Div: _ _ _ , Batch: _ _ _ _ _ _
Roll No: _ _ _ _ _

Subject: Microprocessor and Microcontroller Lab

Sign of Teacher with Date

EXPERIMENT NO: 03
TITLE: Program using Macro
AIM: Write 8086 Assembly Language Program to display personal information, using Macro.
Hardware /Software Requirement:PC, Windows XP/7, 8086 Assembler, Editor.
Objectives:
1. To study concept of Macro.
2. To apply concept of macro in program

Background:
Macros:
Usually, a macro, like a procedure, is defined for performing a specific function. When the repeated
group of instructions is too short or not appropriate to be written as a procedure, then macro is
preferably used. A macro is a group of instructions the user brackets and gives a name to it. Each
time a macro is called in the program, the assembler will insert the defined group of instructions in
place of the call. Replacing the macro with the instructions it represents is commonly called
expanding the macro. Using a macro avoids the overhead time involved in calling and returning
from a procedure.
Syntax:
Name MACRO [parameters]
<Instructions>
ENDM

Pre-Lab Task:
Required interrupt functions:-

Interrupt No.
INT 21H

Function

Description

AH= 09H

To print string of characters.

AH= 4CH

To terminate a program and return at


command prompt.

Required main Instructions:-

Instruction

Description

LEA

Load Effective Address: This instruction determines the offset


of the variable or memory location named as the source and puts
the offset in indicated 16-bit register.

Program Template:
DISPLAY MACRO MSG
; Write down set of instructions to display a message
ENDM
DATA SEGMENT
; Declare various messages to display personal information
DATA ENDS
CODE SEGMENT
ASSUME CS: CODE, DS: DATA
MOV AX, DATA
MOV DS, AX
; Initialization of DS register
; Call macro some number of times, to display all required personal information
MOV AH, 4CH
INT 21H
CODE ENDS
END

; To terminate a program

In-Lab Task:
Students will execute a complete program as per following algorithm and will write down
the Result/Output.
Algorithm
1. Define a macro to display the message.
2. Declare various messages containing personal information.
3. Call Macro to display the messages.
4. Terminate the program and return back to OS.

Result/Output: - ____________________________________________________
__________________________________________________________________
__________________________________________________________________
Post-Lab Task:
Outcomes:
Students should understand1. The concept of Macro
2. Passing parameter to a Macro
3. Comparison with Procedure

Reference Books:1. John E. Uffenbeck , The 8086/ 8088 Family: Design, Programming and Interfacing, Pearson.
2. Douglas V. Hall Microprocessor and Interfacing Programming and Hardware Pearson.
3. Peter Abel, IBM PC Assembly Language and Programming Pearson.

Questions for Viva:1. Define a macro.


2. Explain macro expansion.
3. Differentiate between a procedure and a macro.

NameofTeacher

Sign

You might also like