我正在 MASM 中编写一个程序来创建和减去三个 32 位整数。我的问题是,9000
减去30000
似乎会导致27000
,21000
预期的时间。来源如下:
TITLE Add and Subtract
; This program adds and subtracts 32-bit integers.
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
DumpRegs PROTO
.code
main PROC
mov eax,50000h ; EAX = 50000h
mov ebx,30000h ; EBX = 30000h
mov ecx,43h ; ECX = 43h
sub eax,10000h ; EAX = 40000h
sub ebx,9000h ; EBX = 21000h
sub ecx,1h ; ECX = 42h
call DumpRegs
INVOKE ExitProcess,0
main ENDP
END main
DumpRegs 结果如下:
如图所示,EBX
的值00027000
是0021000
预期的时间。这里发生了什么?