I am trying to sum 2 numbers but the program crashes
can I get some help?
I already read this
http://www.website.masmforum.com/tutorials/fptute/fpuchap4.htm
can I get some help?
I already read this
http://www.website.masmforum.com/tutorials/fptute/fpuchap4.htm
SumarFloat proc var1:DWORD,var2:DWORD
fld f1
fld f2
fadd st(0), st(1)
fst dword ptr
ret
SumarFloat endp
Glad to see that you have finally decided to try and learn by reading some of the available literature. However, you are using some of the provided examples out of context. From that tutorial,
I have not seen anything in your code which would set the content of the EAX register to an acceptable memory address. That is most probably the cause of your program crashing if you are trying to write to a memory area which is not allowed .
Raymond
fst? dword ptr ? ?;stores the value of ST(0) in the REAL4 format
? ? ? ? ? ? ? ? ? ? ? ?;at the memory address indicated by EAX
? ? ? ? ? ? ? ? ? ? ? ?;at the memory address indicated by EAX
I have not seen anything in your code which would set the content of the EAX register to an acceptable memory address. That is most probably the cause of your program crashing if you are trying to write to a memory area which is not allowed .
Raymond
Another thing: what are f1 and f2? And what happened to var1 and var2? :)