Handmade Hero»Forums»Code
Livet Ersomen Strøm
163 posts
C++ community edition
Right, so I have finally installed this marvelous piece of software, just so I can properly follow along HMH, and I am eager to learn how to use it. And I wonder: is there a language feature to enable pasteing assembly directly into my source?
Mārtiņš Možeiko
2562 posts / 2 projects
C++ community edition
Visual Studio allows to do inline assembly only for 32-bit code. Here are examples how to use it: http://msdn.microsoft.com/en-us/library/45yd4tzz.aspx

For 64-bit code you'll need to put assembly codein separate .asm files. You can use either MASM compiler (ml.exe/ml64.exe, shipped with Visual Studio). Or use different ones (like yasm, nasm) that will allow to compile same assembly file on different OS'es (Linux, OSX).
Livet Ersomen Strøm
163 posts
C++ community edition
mmozeiko
Visual Studio allows to do inline assembly only for 32-bit code. Here are examples how to use it: http://msdn.microsoft.com/en-us/library/45yd4tzz.aspx


Brilliant!

mmozeiko

For 64-bit code you'll need to put assembly codein separate .asm files. You can use either MASM compiler (ml.exe/ml64.exe, shipped with Visual Studio). Or use different ones (like yasm, nasm) that will allow to compile same assembly file on different OS'es (Linux, OSX).


Good to know. Thanks.