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

42. Variadic Functions

Jo Van Hoey1 
(1)
Hamme, Belgium
 
A variadic function is a function that takes a variable number of arguments. A good example is printf. Remember, in Linux assembly, when we use printf with xmm registers, the convention is that rax contains the number of xmm registers that printf has to use. This number can also be retrieved from the printf format instruction, so often you can get away without using rax. For example, the following format indicates that we want to print four floating-point values, each with nine decimals:
    fmt     db    "%.f",9,"%.f",9, "%.f",9,"%.f",10,0

Even if we do not comply with the convention to ...

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.