4 ms·
I'm not sure you need to use assembly for writing the MSVC version, it supports the "naked" calling convention: https://learn.microsoft.com/en-us/cpp/cpp/rules-
by speps 4y ago
I'm not sure you need to use assembly for writing the MSVC version, it supports the "naked" calling convention: https://learn.microsoft.com/en-us/cpp/cpp/rules-and-limitations-for-naked-functions https://learn.microsoft.com/en-us/cpp/cpp/rules-and-limitati...
Similarly, it has the "noreturn" decl spec: https://learn.microsoft.com/en-us/cpp/cpp/noreturn https://learn.microsoft.com/en-us/cpp/cpp/noreturn
It'd be interesting if that works the same as in GCC for the article 's objective.
- flohofwoe 4y agoMSVC doesn't support inline assembly for x86-64 (the declspecs are just hinting the compiler to not generate function entry/exit code and that it shouldn't be confused by the function not returning to the caller - not sure if declspec(naked) even works on x86-64 because I think it only makes sense with inline assembly).