Problem with allocation code x64

18 views
Skip to first unread message

haox...@gmail.com

unread,
Dec 5, 2013, 4:40:22 AM12/5/13
to asmji...@googlegroups.com
Hi! I have some problem with writing instruction at allocated memory:

Assembler a;
a
.mov(qword_ptr_abs((void*)0x15FE70000),rbx);


After write code obtained like this:
48891C250000E73F  - mov [5FE70000],rbx


Should be like this:
48891DF9FFFEFF     - mov [15FE70000],rbx


What's the problem? Using Win7 x64 with VS2010. Target and project is x64-bit. Thanks!


Petr Kobalíček

unread,
Dec 5, 2013, 10:04:29 AM12/5/13
to asmjit-dev
Hi,

there is no absolute memory addressing in 64-bit mode except for using mov_ptr, you address is truncated to 32-bits in your case. If you need to store to an absolute location you should first move the pointer to register and then use that register as a base pointer. If you have a structure or data that is indexed you can use advanced addressing to keep address only in one register.

Hope that helps!

Best,
Petr

--
 
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

haox...@gmail.com

unread,
Dec 5, 2013, 7:50:48 PM12/5/13
to asmji...@googlegroups.com
Thanks for the quick answer, I'll try it...

在 2013年12月5日星期四UTC+8下午11时04分29秒,petr kobalicek写道:
Reply all
Reply to author
Forward
0 new messages