Is it possible to access 32-bit registers in C?

后端 未结 7 1294
猫巷女王i
猫巷女王i 2020-12-14 11:55

Is it possible to access 32-bit registers in C ? If it is, how ? And if not, then is there any way to embed Assembly code in C ? I`m using the MinGW compiler, by the way. Th

相关标签:
7条回答
  • 2020-12-14 12:36

    You can of course. "MinGW" (gcc) allows (as other compilers) inline assembly, as other answers already show. Which assembly, it depends on the cpu of your system (prob. 99.99% that it is x86). This makes however your program not portable on other processors (not that bad if you know what you are doing and why).

    The relevant page talking about assembly for gcc is here and here, and if you want, also here. Don't forget that it can't be specific since it is architecture-dependent (gcc can compile for several cpus)

    0 讨论(0)
提交回复
热议问题