answersLogoWhite

0


Best Answer

A macro is a group of repetitive instructions in a program which are codified only once and can be used as many times
as necessary.

The main difference between a macro and a procedure is that in the macro the passage of parameters is possible and in the
procedure it is not, this is only applicable for the MASM - there are other programming languages which do allow it.
At the moment the macro is executed each parameter is substituted by the name or value specified at the time of the call.

We can say then that a procedure is an extension of a determined program, while the macro is a module with specific
functions which can be used by different programs.

Another difference between a macro and a procedure is the way of calling each one, to call a procedure the use of a
directive is required, on the other hand the call of macrosis done as if it were an assembler instruction.
Example of procedure:
For example, if we want a routine which adds two bytes stored in AH and AL each one, and keep the addition in the BX register:


Adding Proc Near ; Declaration of the procedure
Mov Bx, 0 ; Content of the procedure
Mov B1, Ah
Mov Ah, 00
Add Bx, Ax
Ret ; Return directive
Add Endp ; End of procedure declaration

and an example of Macro:

Position MACRO Row, Column
PUSH AX
PUSH BX
PUSH DX
MOV AH, 02H
MOV DH, Row
MOV DL, Column
MOV BH, 0
INT 10H
POP DX
POP BX
POP AX
ENDM

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between a macro and a stored procedure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Difference between macro and micro?

Macro is big micro is little


What is the difference between executing a macro and calling a macro?

Calling a macro loads the macro into memory, while executing the macro runs the macro.


What is the difference between macro and micro neutrons?

macro is bigger than micro


Difference between procedures and macros in 8086?

1.procedure does occuie minimum memory space than macro.2..overhead delay in macro is absent..3.in macro machine code is generated for instructions each time when it is called but in procedure machine code for instruction is put only once in the memory..4.proc is accessed by call and set instr ..macro is accessed with the name given..


What is the difference between macro and micro decomposers?

The difference between macro and micro decomposers is micro decomposers can't be seen by the naked eye while macro decomposers are big enough so they can be seen.


Micro to macro processes in an ecosystem?

t s the difference between micro and macro process in the ecosystem?


Give the differences between micro and macro economics?

ten difference of micro economics macro economics


What is the difference between a macro burst and a micro burst?

nuguu


What is the difference between macro and microeconomics?

macro- and microeconomics courses (the "big picture" versus individual companies/persons)


Difference between micro hardness and macro hardness test?

micro is on a small scale and macro on a larger scale


What is the difference between Marco and aperture?

The same as the difference between huoses and oranges. Did you mean "macro" instead of "marco"?


Differences between micro environment and macro environment of an organization?

Uranus is the greenish blue planet and it is gaseous.