abi

Why does eax contain the number of vector parameters?

a 夏天 提交于 2020-12-23 11:13:01
问题 Why does al contain the number of vector parameters in assembly? Why are vector parameters any different from normal parameters for the callee? 回答1: The value is used for optimization as stated in the ABI document The prologue should use %al to avoid unnecessarily saving XMM registers. This is especially important for integer only programs to prevent the initialization of the XMM unit. 3.5.7 Variable Argument Lists - The Register Save Area. System V Application Binary Interface version 1.0

Can a C compiler generate an executable 64-bits where pointers are 32-bits?

谁说我不能喝 提交于 2020-12-01 09:02:18
问题 Most programs fits well on <4GB address space but needs to use new features just available on x64 architecture. Are there compilers/platforms where I can use x64 registers and specific instructions but preserving 32-bits pointers to save memory? Is it possible do that transparently on legacy code? What switch to do that? OR What changes on code is it necessary to get 64-bits features while keep 32-bits pointers? 回答1: A simple way to circumvent this is if you'd have only few types for your

Can a C compiler generate an executable 64-bits where pointers are 32-bits?

别说谁变了你拦得住时间么 提交于 2020-12-01 09:02:09
问题 Most programs fits well on <4GB address space but needs to use new features just available on x64 architecture. Are there compilers/platforms where I can use x64 registers and specific instructions but preserving 32-bits pointers to save memory? Is it possible do that transparently on legacy code? What switch to do that? OR What changes on code is it necessary to get 64-bits features while keep 32-bits pointers? 回答1: A simple way to circumvent this is if you'd have only few types for your

What's the best way to remember the x86-64 System V arg register order?

一世执手 提交于 2020-11-25 03:41:39
问题 I often forget the registers that I need to use for each argument in a syscall, and everytime I forget I just visit this question. The right order for integer/pointer args to x86_64 user-space function calls is: %rdi , %rsi , %rdx , %rcx , %r8 and %r9 . (with variadic functions taking AL = the number of FP args, up to 8) Or for system calls, %rax (syscall call number), and same args except %r10 instead of %rcx . What's the best way to remember these registers instead of google this question