I'm totally a beginner in the assembly language. I'm trying to translate b^2-4ac in assembly code for simple calculation. This is my code and I can't figure out how I can display the output of this program.
Note: When I run this code in Visual Studio 2019, this executes without any error but doesn't show any output.
This is my code:
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
.data
delta SDWORD ?
a SDWORD 6
b SDWORD 3
cc SDWORD 4
.code
main proc
; b^2-4ac
mov eax,a
mov ebx,b
mov ecx,cc
imul ebx,b ; b^2
imul eax,4 ; 4a
imul eax,cc ; 4a*c
sub ebx,eax ; b^2-4ac
mov delta,ebx ; delta = b^2-4ac
invoke ExitProcess,0
main endp
end main