首页 > 解决方案 > 有谁知道为什么在 Visual Studio 2019 上使用 masm 代码时会弹出此错误?

问题描述

这是实际的代码:


extrn ExitProcess : proc

.DATA
num QWORD 80
sum QWORD ?

.CODE

_main PROC
 mov rax, num
 add rax, 20
 mov sum, rax

xor rxc, rcx
call ExitProcess
_main ENDP
END

使用调试器时出现此错误:

1>------ Build started: Project: helloMASM, Configuration: Debug x64 ------
1>Assembling HelloMASM.asm...
1>HelloMASM.asm(16): error A2006: undefined symbol : rxc
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml64.exe /c /nologo /Zi /Fo"x64\Debug\HelloMASM.obj" /W3 /errorReport:prompt  /TaHelloMASM.asm" exited with code 1.
1>Done building project "helloMASM.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

知道为什么会这样吗?另外,我注意到我在视觉工作室的以下模式中没有“注册”选项:

Debug->windows->registers

我只有这个: 在此处输入图像描述

我尝试重新安装程序,但仍然存在。任何线索将不胜感激,谢谢。

标签: assemblyvisual-studio-2019masm

解决方案


是的,我用“rxc”拼错了“rcx”,所以正确地写它解决了我的问题。此外,一旦我单击调试器,“调试”菜单下的“注册”选项就会出现。感谢您的帮助!


推荐阅读