1

Assembly : Converting x86 code to x64 for a simple example

view story
linux-howto

http://stackoverflow.com – While I'm learning x64 assembly, I'm trying to make add method to add two integers and return integer using assembly. I had the working code with x86 and I tried to convert to x64 simply I changed the registers' names to be that of x64 and the object file generated without errors but when I use it inside my C function I always get sum = 0. I think there's a problem with the arguments location and I didn't find a good documentation for such issues. section .text global addi addi: push rbp mov rbp, rsp mov rax,[rbp+12] mov rdx,[rbp+8] add rax, rdx (HowTos)