Re: A89: macros vs. subroutines


[Prev][Next][Index][Thread]

Re: A89: macros vs. subroutines




>when you use a subroutine the processor jumps to the location of the
subroutine
>and then jumps back.. when you use a macro, the assembler is copying that
>macrocode to every place you use it before assembly, so you get the same
piece
>of code at every spot you use the macro..
>macros are a feature in the assembler, not the processor...

A program that uses macros instead of functions will be larger since that
section of code is pasted many times into the code.  However, it will be
slightly faster since you save the two jump instructions and instructions
used to push variables onto the system stack.  The general rule that I've
been taught is that macros shouldn't be longer then the number of times it
is used times three.

	--Nate


References: