2 ms·
This article helped me a bit when porting Shake to x86_64 (the first in the series is linked from the article): http://blogs.msdn.com/b/oldnewthing/archive/200
by davvid 14y ago
This article helped me a bit when porting Shake to x86_64 (the first in the series is linked from the article):
http://blogs.msdn.com/b/oldnewthing/archive/2004/01/14/58579.aspx http://blogs.msdn.com/b/oldnewthing/archive/2004/01/14/58579...
The x86_64 calling convention can be a bit hairy. C.f. http://blog.nelhage.com/2010/10/amd64-and-va_arg/ http://blog.nelhage.com/2010/10/amd64-and-va_arg/
The best thing about really large C++ applications with assembly glue deep in their core is that nothing works until you rewrite the glue for the new platform.
You can't debug the thing like a normal app when its hand-rolled threading and mutex library from 1997 doesn't work. So you tread forward; only suckers use debuggers. You can tell what it's supposed to do by reading the assembly and function names from the other platforms... (ppc, alpha (SGI), and i386 in this case).
Naturally, none of the assembly parts had any documentation. Honestly, it's probably good that they didn't (j/k). My guess as to what they were thinking: "if they don't understand it then they shouldn't be writing the asm for the next platform". I guess they were right.
Finally, you get the glue right and it's an "ah-ha" moment. Everything suddenly starts working.