Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dup : dword_ptr SegReg #22

Closed
maximegmd opened this issue Apr 21, 2014 · 4 comments
Closed

Dup : dword_ptr SegReg #22

maximegmd opened this issue Apr 21, 2014 · 4 comments
Labels

Comments

@maximegmd
Copy link

Hi,

I am trying to produce mov eax,fs[18], this issue already exists on google code : http://code.google.com/p/asmjit/issues/detail?id=75

But the solution is not present in the current code base it seems, is this intended ?

@kobalicek
Copy link
Member

Hi Yamashi,

mov(variable, ptr_abs(18).setSegment(fs));

should do the job.

Close if it works for you.

@maximegmd
Copy link
Author

Hi,

It seems to be what I need, the console output does match the expected result, but executing the code results in the following disassembly in VS, it also throws a read exception on execution

mov   eax,dword ptr fs:[di]

And di contains random values, never 18 though.

My code is pretty straight forward

c.addFunc(x86x64::kFuncConvCDecl, FuncBuilder0<int32_t>());

GpVar a(c);
c.mov(a, ptr_abs(0x18).setSegment(fs));
c.ret(a);

c.endFunc();

@kobalicek kobalicek added the bug label Apr 22, 2014
kobalicek added a commit that referenced this issue Apr 22, 2014
@kobalicek
Copy link
Member

I think I tracked it down, please check the master and let me know if it works for you.

@maximegmd
Copy link
Author

It works thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants