Active Members
TodayLast 7 Daysmore...


Resources » Articles/Knowledge Sharing » Computer & Technology

Diffrences between macro and procedure


Posted Date:     Category: Computer & Technology    
Author: Member Level: Silver    Points: 3


Macro and procedure are the functions used in microprocessors to minimize the code.There is a huge difference between macro and procedure.



 

Macro and procedure both are used to shorten the code of the programs done in microprocessor.Though both are used for the same purpose but they differ completely in their functioning,Both performs their part in the program differently and provide different environment for the program to use the benefit of these powerful functions.

Lets see the difference between macro and procedure

1) The invocation of macro in the program invokes the code in the program with the codes defined in the program.Whereas when procedureis called it sends the control to the starting address of the code defined in the procedure and the code is invoked in the program.

2) There is branched execution in case of macro but there is sequential execution in case of procedure.

3) Macro does not make use of stack as the codes are defined in a macro within the register and these codes are invoked with the help of macro at different parts of the program wherever they are needed.In the case of Procedure it makes use of stack may be the system stack or explicitly defined stack.The registers are pushed onto the stack and are popped back before the end of the procedure.
4) Macro increases the length of the program if macro is invoked several times within the program.But the procedure is called by pointing to the address in the memory where procedure is stored.
5) Macro is comparatively slower as there is branched execution and procedure is faster as there is sequential execution.


Macro and procedure both helps us in shortening our program,we have to decide where we have to use macro and where we have to use procedure.

While defining procedure if we use stack explicitly we have to define stack segment.

In the case of macro we have to write include (file name).macro
before the data segment or code segment(if in some case data segment is absent).

with regards
ARYAN

Attachments
  • syntax and flowchart (128670-61311-macro-and-procedure.docx)





  • Did you like this resource? Share it with your friends and show your love!





    Responses to "Diffrences between macro and procedure"
    Feedbacks      

    Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: How to check that whether a particular website is secure or not?
    Previous Resource: Layout Designing
    Return to Resources
    Post New Resource
    Category: Computer & Technology


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Macro and procedure  .  
    Awards & Gifts
    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.