0

I will risk a question, sorry if the question is simple.

Currently, I am refreshing the knowledge of C. I was browsing a book and found something completely new for me, namely the keyword "__asm", can anyone share their experiences, where did the need to use it come from or in what cases can it be used?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
reg3x_mr
  • 75
  • 1
  • 10
  • 2
    https://stackoverflow.com/tags/inline-assembly/info has some pointers. – Nate Eldredge Apr 19 '21 at 07:24
  • Oh, ok. That's enough, but I must admit that I searched the prompts and this post was not displayed to me. – reg3x_mr Apr 19 '21 at 07:26
  • 3
    Generally https://gcc.gnu.org/wiki/DontUseInlineAsm if you can avoid it. There aren't a lot of good use-cases. Notably for Windows, MSVC has intrinsics for basically everything including privileged instructions, although with other compilers (like gcc/clang where you'd use `__asm__()` or `asm()`) you could need it for instructions that don't have intrinsics. – Peter Cordes Apr 19 '21 at 07:27

0 Answers0