3 ms·
I haven't checked - on phone - but is the ABI described MSVC or GCC ?
by djmips 4y ago
I haven't checked - on phone - but is the ABI described MSVC or GCC ?
- dennis_moore 4y ago"To call a function, the program should place the first six integer or pointer parameters in the registers %rdi, %rsi, %rdx, %rcx, %r8, and %r9." This sounds like System V, hence GCC.
- iamcreasy 4y agoCan you kindly recommend me a book to learn more about ABI and the associate information such as computer architecture etc? In university I've written as assembler, a compiler and also took computer architecture class but still I do not seem to understand the ABI.
- maldev 4y agoUnironically the NASM docs are AMAZING for this, and by far the best. https://www.nasm.us/xdoc/2.15.05/html/nasmdoc0.html https://www.nasm.us/xdoc/2.15.05/html/nasmdoc0.html . For example for 64bit windows https://www.nasm.us/xdoc/2.15.05/html/nasmdo12.html#section-12.4 https://www.nasm.us/xdoc/2.15.05/html/nasmdo12.html#section-... . There's also this for formats, this is windows for example. https://www.nasm.us/xdoc/2.15.05/html/nasmdoc8.html#section-8.6 https://www.nasm.us/xdoc/2.15.05/html/nasmdoc8.html#section-... For general systems programming/asm, AMD has REALLY well written documentation. Intel is better for edge cases and are more explicit. But when learning the explicitness makes it more complicated and AMD reads on the level of a regular person, not some 80 year old greybeard who writes asm in hex codes.
- iamcreasy 4y agoThank you. But I was wondering if there is any reputable text book that I can read front to back that will give me a good overview with examples. Connecting ABI in relation to MSVC, GCC and System V as the sibling comment mentioned. I have use MASM before, and I am not sure if NASM manual contains what I am looking for - but I'll take a look.
- garaetjjte 4y agoFor x86/x86-64, take a look at https://www.agner.org/optimize/calling_conventions.pdf https://www.agner.org/optimize/calling_conventions.pdf