【发布时间】:2013-04-29 02:11:16
【问题描述】:
我在尝试构建此代码时收到此错误:
1>------ Build started: Project: Project, Configuration: Debug Win32 ------
1> Assembling [Inputs]...
1>assign2.asm(12): error A2022: instruction operands must be the same size
1>assign2.asm(13): error A2022: instruction operands must be the same size
当我尝试从usPop 中减去ml1337skillz 并将结果存储到Difference 时会发生这种情况。我使用eax 作为它的临时寄存器。
TITLE Learning (learning.asm)
INCLUDE Irvine32.inc
.data
usPop DWORD 313900000d ; 32-bit
my1337Sk1LLz WORD 1337h ; 16-bit
Difference SWORD ? ; 16-bit
.code
main PROC
FillRegs:
mov eax,usPop ;load 3139000000d into eax ; fine
sub eax,my1337Sk1LLz ;subtracts 1337h from usPop in eax ; error #1
mov Difference, eax ;stores eax into Difference ; error #2
call DumpRegs ;shows Registers
exit ;exits
main ENDP
END main
【问题讨论】: