© Jo Van Hoey 2019
J. Van HoeyBeginning x64 Assembly Programminghttps://doi.org/10.1007/978-1-4842-5076-1_18

18. Macros

Jo Van Hoey1 
(1)
Hamme, Belgium
 

When you use the same set of instructions several times in a program, you can create a function and call that function every time you need to execute the instructions. However, there is a performance penalty with functions: every time you call a function, the execution jumps to the function at some place in memory and, when finished, jumps back to the calling program. Calling and returning from a function takes time.

To avoid this performance issue, you can work with macros. Similar to functions, macros are a sequence of instructions. You assign a name to the macro, and when you need to execute the ...

Get Beginning x64 Assembly Programming: From Novice to AVX Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.