使用 Visual Studio 调试 ASM - 不会显示注册内容 [英] Debugging ASM with Visual Studio - Register content will not display
问题描述
我一直在为一个类做一个汇编语言项目,虽然我终于能够解决这段代码中的所有问题(我相信),但我现在似乎无法显示注册内容.
I have been working on an assembly language project for a class and though I have finally been able to work through all problems in this code ( I believe ), I now can't seem to get the Register contents to display.
这是我的代码...
include C:IrvineIrvine32.inc
.data
;Variables are listed in following order VAR DATATYPE DIGITS[RADIX] with
comments showing binary version of listed digits
left DWORD 321 ;101000001b
right DWORD 4247 ;1000010010111b
total DWORD ? ;uninitialized
diff DWORD ? ;uninitialized
;Define a string called message containing HELLO WORLD!
message BYTE '"Hello world!"'
;Calculate length of Array and move to var ArrayLength
Array WORD 1,2,4,8,16,32,64 ;Array
ArrayLength = ($ - Array) / 2
.code
main PROC
;Move left and right to respective registers
MOV eax,left
MOV ebx,right
;Add left var and right var and store in new var called total and move to
ecx
MOV total,eax
ADD total,ebx
MOV ecx,total
;Subtract left var and right var and store in new var called diff and move
to edx
MOV diff,eax
SUB diff,ebx
MOV edx,diff
;Move Array to esi
MOV esi,ArrayLength
call DumpRegs
exit
main ENDP
END main
当我调试时,我没有收到任何错误消息,但 IDE 没有显示我需要的寄存器或其内容.
When I debug I get no error messages but the IDE does not display the registers or its contents which I need.
我到处搜索以尝试查看可能是什么问题并得到了一些答案,并且能够在此网站上找到一些有关在 VS 中打开注册窗口的信息...
I searched everywhere to try and see what might be the problem and got some answers and was able to find some regarding opening the register window in VS on this website...
https://msdn.microsoft.com/en-us/library/62680774.aspx
但我尝试在我的 IDE 中找到这个窗口,即使在启用地址级调试后,但无济于事.我不知道是我的安装方式有问题还是 VS2017 中没有注册窗口...非常欢迎任何帮助
But I tried to find this window in my IDE even after enabling address-level debugging but to no avail. I don't know if it is a problem with how I installed or is there no register window in VS2017 ... any help would be very welcome
为了记录,我正在使用 Visual Studio 2017
For the record I am using Visual Studio 2017
我尝试在 call DumpRegs
甚至断点之后添加一个等待,但这只会停止运行并且不显示任何寄存器..
I have tried adding a wait after call DumpRegs
and even a breakpoint but that simply stalls the run and doesn't display the registers whatsoever..
推荐答案
感谢@Jester,我能够看到寄存器窗口.(请参阅 如何使用寄存器窗口 在 Visual Studio 文档中.)
Thanks to @Jester I was able to see the registers window. (See how to use the registers window in the Visual Studio docs.)
这可能是微不足道的,但我还是会说出来.为了看到注册窗口,您需要在程序退出之前输入断点,或者使用 Irvine wait
宏或 call ReadChar
,或类似的.
It may be trivial but I will state it nonetheless. In order to see the register window you need to input a breakpoint before the exit of the program or write your program to pause on it's own using the Irvine wait
macro, or call ReadChar
, or similar.
暂停后,您可以通过调试窗口和窗口子窗口进入寄存器窗口,瞧,您可以看到寄存器内容.
After it pauses, you can reach the register window by going to debug window and windows sub-window, and voila, you have the register contents visible.
这篇关于使用 Visual Studio 调试 ASM - 不会显示注册内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!