I would like to write a function in NASM System V ABI x86-64 (Intel Syntax) that I could use in a C program. Here is the prototype of the function: I therefore retrieve the parameters in order (const char *s = rdi, int c = rsi) First, I get the character stored in the register rsi and put it in
Tag: calling-convention
How are parameters passed to Linux system call ? Via register or stack?
I trying to understand the internals of the Linux kernel by reading Robert Love’s Linux Kernel Development. On page 74 he says the easiest way to pass arguments to a syscall is via : Somehow, user-space must relay the parameters to the kernel during the trap.The easiest way to do this is via the same means that the syscall number
X86-64 passing float and int as arguments
When passing a float to a function as the first argument the %xmm0 register gets set. What if we want to pass an integer as the second argument in the function. Which one of %rdi or %rsi gets the argument? e.g. avg ( float f, int i ) Is the order preserved, so that %rsi will get the int? Edit:
Segmentation fault in my Assembly implementation
I am new to assembly language programing, and here I am trying to call C standard library function puts from my assembly code, but I am continuously getting segmentaion fault. Please help; Operating system : LINUX 16.04 Assembler : nasm Machine : intel x86 – 64bit Answer to explain Comments More, start with x86 calling convention and your code. x86
Function arguments in x86-64 asm
So I have to do this project for school that consists of reading a file in brainfuck and interpret it as assembly. The code works if I save the file path as a String inside the .data section, but what I want to have it so it gets the file path as an argument when starting the code in the