用汇编程序求解方程式,停留在用户输入上

时间:2018-10-07 22:27:40

标签: sasm

尝试执行y =(x ^ 3 + 3r-4)/(2w-3z),但不确定如何进行用户输入。

包括c:\ asmio \ asm32.inc includelib c:\ asmio \ asm32.lib includelib c:\ asmio \ user32.lib includelib c:\ asmio \ kernel32.lib

.const     NULL = 0

.data     Prime db 100     月db 12     X字?     R字?     W字?     Z字?     是DWORD吗?

MSS1 byte "Y = ", NULL
MSS2 byte "X = ", NULL
MSS3 byte "R = ", NULL
MSS4 byte "W = ", NULL
MSS5 byte "Z = ", NULL

.code 主程序

mov edx, offset MSS2 
call WriteString
call readInt
mov X, edx
mov eax, X ;--
imul X     ;----- X^3
imul X     ;--
mov ebx, eax   
mov ebx, R
imul 3
add eax, ebx
sub eax, 4
mov ecx, W
imul 2
mov edx, ecx
mov edx, Z
imul -3
add ecx, edx
mov eax, ecx
div eax, ecx



mov edx, offset MSS1 
call WriteString
call readInt 

ret 0 

主要结局     结束

0 个答案:

没有答案