3-8-2015
This code gives the wrong value in GoAsm 64-bit
Value should be 0.006
Incorrect value is 280461;
hdc dq 0
n1 dq 0
n2 dq 15 ;fixed value
n3 dq 0 ; result
buf db ' ',0
HoldValue db ' ',0 ; keyed in variable input ex: 0.090
lea rcx,HoldValue ; value is keyed input
mov [n1],rcx ; (This is what I don't know how to do)
fld Q[n1] ;load n1 into the ST0 register on the fpu stack
fdiv Q[n2] ; divide it by n2 directly from memory
fstp Q[n3] ; pop the results off the stack to memory
invoke msvcrt:sprintf_s,addr buf,sizeof buf,\
"%g",[n3]
invoke TextOut, [hdc],200,345,addr buf,7