# Need to Learn x86-64 Assembly

This topic is 4608 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well, more accurately, I need a couple pieces of information in particular. I've got the AMD manuals right next to me, and I already know x86-32 assembly. What I need to know are these: 1. How are C-declared function names decorated using the x86-64 calling convention (I found a reference that lists the parameter passing conventions, return conventions, and register preservation requirements, but it doesn't mention the name decoration)? 2. What is this about keeping the stack aligned to 16 bytes? I've seen it mentioned in a couple of places, but I couldn't manage to figure out exactly what was required (it really confuses me when they talk about leaf and nonleaf functions, because shouldn't stack alignment by definition apply to all functions?)?

##### Share on other sites
Quote:
 1. How are C-declared function names decorated using the x86-64 calling convention (I found a reference that lists the parameter passing conventions, return conventions, and register preservation requirements, but it doesn't mention the name decoration)?

Regular C doesn't decorate function names. The name of the function is the name of the function, and that's it; no return type or parameter information. C++ has name decoration, but I believe that's compiler-specific (which is one reason why people generally use undecorated C function names when exporting functions).

##### Share on other sites
Actually, the decoration of function names is dependent on the tool chain (compiler/linker). You have to go look at the tools you're using (GCC? Proton?) to get this information.

As an example, K&R style C compilers used to always decorate functions with a leading underscore.

and esp, 0xfffffff0