我在 Google 上做了很多工作,寻找一种可以将机器代码直接包含在程序集源文件中的方法。我没有运气。
我所说的“内联机器代码”的意思可能不清楚,所以让我为您提供一个我正在寻找的示例:
; here's my normal assembly code...
mov eax, 8
add eax, 10
; now I would like to be able to add some machine code
__machinecode__("40") ; this is equivalent to 'inc eax' (I think!)
就是这样了。