What is wrong with this code?
code:
.686
.xmm
.data
Record_Save Struct
epoch_m dq 0
Record_Save EndS
.code
cvttsd2si eax,Record_Save.epoch_m
I am using ml V7.10.2179
Thanks,
Jim
I put this in a test file by itself and I get the same results. What I do not understand is, according to Intel's Manuels, cvttsd2si is defined as:
cvttsd2si r32, xmm/m64
The member of the structure is 64 bits going into a 32-bit register.
I get this error: invalid instruction operands
Where am I going wrong?
Jim
Code:
.686
.model flat, stdcall
Option Casemap:NONE
.xmm
.data
Record_Save STRUCT
epoch_m dq 0
Record_Save EndS
.code
Start:
cvttsd2si eax, Record_Save.epoch_m
End Start
Jim, I just added the code tags so it was easier to read.
Jim,
The format of the value loaded in the structure QWORD may be incorrect. I would try it with a floating point format number loaded at the memory location.
Yes, that led me to see that I was not initializing the Floating Point variables correctly.
Now, the cvttsd2si STILLl did not like the structure member. It worked perfectly from a normal real8 variable.
This leads me to believe that I should stay away from structures as I will be doing extensive work with real8 variables. The sturcture just makes it easier to be organized.
Thanks, Hutch,
Jim
Problem solved with structure members using cvttsd2si or possibly other xmm directives as well.
In my code:
cvttsd2si eax,Record_Save.epoch_m
Correct this to read:
cvttsd2si eax,cs:Record_Save.epoch_m
and it assembles without error. :clap: :clap: :clap: as with the math processor.
Jim