I am having problems accessing a static variable with Inline Assembler in the programming language D. The documentation says that I need to access local variables using
mov EAX, var[EBP];
and class variables with
mov EBX, this;
mov EAX, var[EBX];
But it does not document how to access a static variable. Here is my code that causes the error:
module test;
static int A = 1234;
static void SetA()
{
asm
{
mov A, 5432;
}
}
I really need a “global storage” method for integers available from both assembler and D, I would be very happy for any help with this (or an alternative way).
source
share