当我尝试构建此代码时出现此错误:
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
当我尝试从中减去ml1337skillz
并将usPop
结果存储到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