大家好我是新來的彙編語言,我不知道如何創建一個程序來讀取3個16位整數a,b ,然後讓它計算出判別式。 (b^2-4ac) 任何人都可以幫助我嗎? 到目前爲止,我開始嘗試讓程序與a和c相乘。如何用匯編語言計算判別式(b^2 - 4ac)
.data
Prompt BYTE "Enter a number ?" , 0
Message BYTE "The discriminant is: ", 0
b SDWORD ?
a SDWORD ?
cc SDWORD ?
discriminant SDWORD ?
.code
main PROC
mov edx, OFFSET Prompt ; EDX must have the string's offset
call WriteString ; Call the procedure to write a string
call ReadInt ; Call the procedure to read an integer
mov a, eax ; The integer is read into AL, AX or EAX
mov edx, OFFSET Prompt ; Read another integer
call WriteString
call ReadInt
mov cc, eax
mov eax, a ; AL AX or EAX must have the
; multiplicand
cdq ; Clear the EDX register
imul cc ; One operand - the multiplier
mov Product, eax ; The product is in AL, AX or EAX
嗨我其實也不知道C的任何東西。我開始與大會 – Andy 2013-03-02 04:19:19
[哦,好的...](http://tinyurl.com/7zlwvql) – 2013-03-02 04:23:45