2

我在 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!)

就是这样了。

4

1 回答 1

7

我所知道的所有汇编程序都有这样的功能。

mov eax, 8
db 90h ; this is "nop"
add eax, 10
于 2013-04-09T20:00:46.950 回答