Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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-limitati...

Similarly, it has the "noreturn" decl spec: 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.



MSVC 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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: