0
6.7kviews
Comparison between Macros and Procedure

SUBJECT: MICROPROCESSOR AND PERIPHERALS INTERFACING

TOPIC: INSTRUCTION SET AND PROGRAMMING OF 8086

DIFFICULTY: MEDIUM

1 Answer
1
401views

Comparison between Macros and Procedure :-


PROCEDURE MACROS
Procedures are used for large group of instructions to be repeated. Macros are used for small group of instructions to be repeated.
Object code is generated only once in memory. Object code is generated everytime the macro is called.
CALL & RET instructions are used to call procedure and return from procedure Macro can be called just by writing its name.
Length of the object file is less. Object file becomes lengthy.
Directives PROC & ENDP are used for defining procedure.. Directives MACRO and ENDM are used for defining MACRO.
More time is required for it’s execution. Less time is required for it’s execution.
Procedure can be defined as
Procedure_name PROC
------
------
Procedure_name ENDP
Macro can be defined as
MACRO-name MACRO [ARGUMENT ,………. ARGUMENT N]
------
-------
ENDM
For Example
Addition PROC near
------
Addition ENDP
For Example
Display MACRO msg
---------
Please log in to add an answer.