こんにちは、私はアセンブリ言語が初めてで、3 つの 16 ビット整数 a、b、c を読み取って判別式を計算するプログラムを作成する方法がわかりません。(b^2-4ac) 誰か助けてくれませんか? これまでのところ、プログラムで a と c を乗算することから始めました。
.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