Search This Blog

Friday, April 13, 2012

Difference between macros and procedures

Macros
Procedures
Accessed during assembly when name given to macro is written as an instruction in the assembly program.
Accessed by CALL and RET instructions during program execution.
Machine code is generated for instructions each time a macro is called.
Machine code for instructions is put only once in the memory.
This due to repeated generation of machine code requires more memory.
This as all machine code is defined only once so less memory is required.
Parameters are passed as a part of the statement in which macro is called.
Parameters can be passed in register memory location or stack.
I don’t use macros.
I do use procedures.

25 comments:

  1. its very easy to understand........
    Thankyou.........

    ReplyDelete
  2. How about procedures in static languages? such as Fortran 77.

    ReplyDelete
  3. The last difference was absolutely wonderful ☺️☺️☺️☺️ u r a savage af

    ReplyDelete
  4. lol! the last one is indeed true :D

    ReplyDelete
  5. Plz explain with examples also..........it's really good

    ReplyDelete