简体   繁体   English

将汇编语言宏转换为普通汇编语言

[英]Convert assembly language macros to plain assembly language

In MASM, is it possible to convert macro instructions to the corresponding assembly language instructions? 在MASM中,是否可以将宏指令转换为相应的汇编语言指令? I want to convert MASM's macro instructions to plain assembly language instructions, so that I can see how the macros actually work. 我想将MASM的宏指令转换为简单的汇编语言指令,以便可以看到宏的实际工作方式。

For example, I'd like to convert these macro instructions to the corresponding assembly language instructions (without macros): 例如,我想将这些宏指令转换为相应的汇编语言指令(无宏):

.if(x > 5)
    mov eax, x
.else
    mov ebx, x
.endif

I was going to suggest "generate a listing" like 500-InternalServerError proposed, but after verifying it, that won't work - the listing contains only your instructions, not MASM-generated ones. 我本来建议像建议500-InternalServerError那样“生成列表”,但是在验证之后,该列表将不起作用-列表仅包含您的指令,而不包含MASM生成的指令。 What does work is the following: 起作用的是以下内容:

1) Assemble with debug info: 1)组装调试信息:

ml /c /Zi file.asm

2) disassemble with dumpbin (or another disassembler): 2)用dumpbin (或另一个反汇编程序)反汇编:

dumpbin /disasm file.obj

For the example above, it produces: 对于上面的示例,它将产生:

$$000000:
  00000000: 83 3D 00 00 00 00  cmp         dword ptr [x],5
            05
  00000007: 76 04              jbe         @C0001
  00000009: 8B C2              mov         eax,edx
  0000000B: EB 02              jmp         @C0003
@C0001:
  0000000D: 8B DA              mov         ebx,edx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM