Hi,
I am struggling with a little piece of code. Maybe someone can help me.
The challenge:
A piece of assembly code is included in C and uses the xmm and
mmx registers. Their state needs to be restored and saved.
I get a memory exception, although I am aligning by 16.
Always on fxsave instruction; other fxrstor not used yet.
Also I do not know how to get nasm to use the memory adr
of fxmemory directly. I have to write the adress to fxmemory_ptr
first.
Any help welcome.
Thanks.
Bjorn
I am trying to use the following code:
global fxsave_xmmx
fxsave_xmmx:
fwait
fxsave [abs fxmemory_ptr]
ret
global fxrestore_xmmx
fxrestore_xmmx:
fxrstor [abs fxmemory_ptr]
fwait
ret
align 16
global fxmemory_ptr
fxmemory_ptr dq 00h
align 16
global fxmemory
fxmemory dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h
dq 00h,00h,00h,00h,00h,00h,00h,00h