flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Feryno 17 Feb 2006, 08:23
http://www.x86-64.org/documentation/abi-0.96.pdf
A.2.1 Calling Conventions 3.2.3 Parameter Passing Just dl the pdf and read it, especialy Figure 3.4: Register Usage (hard to convert the table into this reply, there are 3 collumns: Register, Usage, Preserved across function calls). The pdf haven't helped me too much, here are my practical experiences (and they are in contradiction with infos from pdf): It looks like there aren't parameters passed on the stack, and limit is max 6 params, but I'm not sure and I have never used more than 4 args to syscall. I pass args in this way: 1st in rax = syscall_number, mov EAX,syscall_number is enough to set RAX 2nd in rbx 3rd in rcx 4th in rdx (I have never passed more args) For memory pointers use lea reg64,[...] as you have written For values use 32-bit reg which is zero extended to 64 bit by CPU itself (e.g. rax=FFFFFFFFFFFFFFFF mov eax,1 rax=0000000000000001 now) this can reduce opcode size (e.g. xor eax,eax is enough for zeroing RAX reg and produce only 2 byte opcode instead of 3 byte xor rax,rax (1 byte rex prefix + 2 bytes opcode) If your ELF is under offset 100000000h, you can use lea reg32,[...] for addressing (saving 1 byte of REX prefix in opcode), but I don't suggest it to you because you cannot load your ELF at RIP=100000000h or higher.
|
|||||||||||
![]() |
|
LocoDelAssembly 17 Feb 2006, 13:50
Thanks Feryno!!!
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.