Good afternoon! In this example, I simply add two numbers with a comma, save the variable in tbyte and display the same variable two times in a row on the screen, but the first time I get 11.1, as it should be, and the second time 4.667261E-062. Why is this happening?
And one more question, is it possible in tbyte to somehow save and access numbers by array type? for example, storing numbers in dd, I just could save and read them in increments of 4, for example, result [0]
, result [4]
, etc. Is it possible to use the same with tbyte and how? If I understand right - it should be a step of 10.
.386
.model flat,stdcall
option casemap:none
include \masm32\include\masm32rt.inc
.data
titletext db 'Title',0
frmt db 'Result1 = %.7G',10
db 'Result2 = %.7G',0
buff db 1024 dup (?)
result tbyte ?
num1 qword 5.5
num2 qword 5.6
.code
start:
finit
fld qword ptr [num1]
fld qword ptr [num2]
fadd
fstp qword ptr [result]
invoke crt_sprintf,addr buff,addr frmt, result, result
invoke MessageBox,0,addr buff,addr titletext,MB_OK
invoke ExitProcess,0
end start