Ok, I first take two numbers from the text fields and convert them to numbers.
mulCode:
mov EDX, 0
push OFFSET zmB
call ScanInt
mov EBX, EAX
push OFFSET zmA
call ScanInt
Then I multiply the variable zmA
by the variable zmB
mul EBX
mov zmA, EAX
And when I put a breakpoint, and look at the value of the variable, then it stores the result of the multiplication, so far everything is fine. But then I again need to convert this result to a string. I am trying to do this with the wsprintfA function.
mov array + 0, eax
push OFFSET buforVar
push OFFSET array
call wsprintfA
jmp printResultMul
printResultMul:
INVOKE TextOutA,hDC,250,120,OFFSET buforVar, rr
mov EAX,0
To do this, I first place the result in the 'array' table, and then in 'buforVar' I want to get it as a string. And somewhere in this place I have a problem. Or am I writing incorrectly first writing the variable to 'array' or something is wrong with the wsprintfA function (also in the code I cannot write its prototype 'wsprintfA PROTO C :VARARG').
Here is what this piece of code looks like together:
mulCode:
mov EDX, 0
push OFFSET zmB
call ScanInt
mov EBX, EAX
push OFFSET zmA
call ScanInt
mul EBX
mov zmA, EAX
mov array + 0, eax
push OFFSET buforVar
push OFFSET array
call wsprintfA
jmp printResultMul
printResultMul:
INVOKE TextOutA,hDC,250,120,OFFSET buforVar, rr
mov EAX,0
Data segment:
wybor DD 0
zmA DD 0
zmB DD 0
zmC DD 2
zmD DD 0
zmE DD 0
zmF DD 0
zmG DD 0
buforVar DD 128 dup(?)
buforVar2 DD 128 dup(?)
buforVar3 DD 128 dup(?)
array dd 20 dup(?)