[Solved] How to access a char from asm in c ,using asm intel syntax?


As @Peter Cordes said to me i read at https://stackoverflow.com/tags/x86/info about OFFSET keyword , and now it works.
I knew the problem is i put in registry a data ,and not a address ,and looks like OFFSET keyword was what I was searching for .

Wrorking one is :

#include <stdio.h>

char buff[] = "%d\n";

int main (void)
{
    asm("mov eax, 3");
    asm("mov esi,eax");
    asm("mov edi,OFFSET buff");
    asm("mov eax, 0");
    asm("call printf");
   return 0;
}

10

solved How to access a char from asm in c ,using asm intel syntax?