這是朋友傳給我的作業答案~
但是我還是不懂~為什麼要用到EAX EBX ECX EDX 這麼多的指令
語法:
;*****This is Assembly Exam 01*****
INCLUDE Irvine32.inc
.data
x1 QWORD 0A02B000190008400h
x2 QWORD 800187008000A904h
sum BYTE 9 DUP(?)
.code
main PROC
mov esi,offset sum
mov EAX,0
mov EBX,0
mov EDX,0
mov ECX,9
mov EAX,DWORD PTR [x1]
add EAX,DWORD PTR [x2]
adc DX,0
CLC
mov EBX,DWORD PTR [x1+4]
add EBX,DWORD PTR [x2+4]
add EBX,EDX
adc DH,0
mov [esi],EAX
mov [esi+4],EBX
mov [esi+8],DL
mov EDX,0
mov edi,0
L1:
movzx EDX,[sum+edi]
push EDX
inc edi
loop L1
mov ECX,9
mov edi,0
L2:
pop EDX
mov [sum+edi],DL
inc edi
loop L2
mov esi,offset sum
mov ECX,9
call DumpMem
call DumpRegs
EXIT
main ENDP
END main