Access class fields from asm

BCS ao at pathlink.com
Fri Jun 22 09:40:11 PDT 2007


Reply to Carl,

> How can i access non-static class fields?

try somthing like this (I haven't even tried to compile this)

public class FooBar {
  public int b = 8;
}
FooBar foo = new FooBar(); // foo is a pointer
asm{
 mov EBX, foo;    // load by value
 mov EAX, [EBX+FooBar.b.offsetof]; //offset from pointer
}  




More information about the Digitalmars-d-learn mailing list