21,458
社区成员
发帖
与我相关
我的任务
分享
Test proc x:dword, y:dword, z:dword
mov eax, x
mov edx, y
shl edx, 1
sub eax, edx
mov edx, z
shl edx, 2
add eax, edx
ret
Test endp
.386
.model flat ,stdcall
include \masm32\include\io32.inc
.stack
.data
x byte "Input number x: ",0
y byte "Input number y: ",0
z byte "Input number z: ",0
result byte "the result is: "
.code
start:
WriteString x
ReadSDecDword eax
push eax
WriteString y
ReadSDecDword ebx
push ebx
WriteString z
ReadSDecDword ecx
pop ebx
pop eax
imul ebx,2
imul ecx,4
neg ebx
add eax,ebx
add eax,ecx
push eax
WriteString result
pop eax
WriteSDecDword eax
ret
end start