Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Difference between Macro and Procedure

The major difference between Macro and Procedure is that the Macro is utilised for a small number of instructions, while on the other hand, the procedure is operated for a large number of instructions. Let’s find out more differences between macro and procedure.

What is Macro?

A macro in computer science is a set of rules or programmable patterns, which decrypts a specific sequence of input into a preset sequence of output. Macros are generally preferred for a small set of rules. Programmers can easily utilise macro anywhere in the program by employing its name.

What is Procedure?

Procedures are used for a large set of rules. They help make a large program more readable. It includes a set of instructions that executes a particular task.

Difference between Macro and Procedure

S.No. Macro Procedure
1 A macro is a set of rules or programmable patterns, which decrypts a specific sequence of input into a preset sequence of output. Procedures are used for a large set of rules that execute a specific task.
2 A macro is used for a small set of instructions. A procedure is used for a large set of instructions.
3 We require more memory in the case of macro. We require less memory in the case of the procedure.
4 In the case of macro, the CALL and RET instructions are not needed. In the case of a procedure, CALL and RET instructions are needed.
5 In macro, the time of execution is lesser than the execution time needed in procedure. In procedure, the time of execution is higher than the execution time needed in macro.
6 In the case of macro, the machine code is constructed several times. In the case of a procedure, the machine code is created only once.
7 A macro parameter is passed as part of a statement that calls macro. In a procedure, parameters are passed in registers and memory locations of the stack.

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Application Form, GATE Syllabus, GATE Cut off, GATE Previous Year Question Paper, and more.

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*