Migrating to AMD64/x86_64

Kumar Rangarajan
1 min readFeb 20, 2019

--

(originally published on 24th Aug 2007 here)

Currently my team is involved in migrating a large heirarchical database onto the x86_64 (AMD64) platform running Linux. The source platform is 32 bit Linux running on x86.

One of the challenges of this port was that this involved migrating assembly files and it also involves generating executable code. Since these are very platform/processor specific functionalities, the port involved understanding the finer aspects of x86_64 and also how different it is from the erstwhile x86 platform.

For starters, we find that the ABI has changed a bit, esp when it comes to calling conventions. On 32 bit x86, all arguments were passed using the stack. But on x86_64, it has 8 more extra registers, and 6 of them are used for argument passing. So the first 6 registers are used for parameter passing, and arguments beyond that are passed via the stack. This is more or less inline with how other RISC processors have implemented their runtime ABI.

One good resource point we found was http://www.viva64.com/links.php which has bunch of references to lot many 64 bit migration sites.

I will post more code snippets and other details of possible interests going forward.

:-)

--

--

Kumar Rangarajan

Obsessive Dictator @ Slang Labs. Earlier co-founded Little Eye Labs, which was acquired by Facebook. A die-hard Illaiyaraja fan and still believes in AAP.