gpt4 book ai didi

assembly - 在 CodeView 中单步执行时 EBX 的高位清零

转载 作者:行者123 更新时间:2023-12-04 17:19:45 25 4
gpt4 key购买 nike

我有以下用 MASM 为 i386 处理器编写的简单程序:

        TITLE   BLA
.MODEL SMALL
.386
.STACK
.DATA
.CODE
MAIN PROC FAR
.STARTUP
MOV EBX,0FFFFFFFFH; (1)
MOV EAX,0EEEEEEEEH; (2)
.EXIT
MAIN ENDP
END

我对 EBX 寄存器的行为感到困惑。在 (1) 指令之后,EBX 被设置为 1-s:

enter image description here

执行 (2) 指令不仅将值加载到 EAX 中,还将 EBX 的上半部分置零:

enter image description here

为什么会发生?

最佳答案

据微软称,这是 Codeview 中的一个已知错误。请参阅知识库文章 Q87548 :

SYMPTOMS

When single-stepping or tracing through code in Microsoft CodeView versions 4.0, 4.01, and 4.05, the lower half of the 32-bit registers (eax, ebx, edi, etc.) is always preserved, but the upper half may be corrupted. Other 386- specific registers, such as the gs and fs registers, may also be corrupted. This problem also occurs when animating. This problem does not occur if the instructions are not executed one at a time.

STATUS

Microsoft has confirmed this to be a problem in CodeView version 4.0, 4.01, and 4.05. This problem was corrected in CodeView version 4.1.



根据这篇文章,修复方法是获取 Codeview 4.1 或更高版本。

关于assembly - 在 CodeView 中单步执行时 EBX 的高位清零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55148016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com