How can I read the register value for a variable with a single built-in assembler command? I am using gcc on the old freeBSD system (v2.1 i386).
I have a code like this:
static volatile unsigned long r_eax, r_ebx; asm ("movl %%eax, %0\n" :"=r"(r_eax)); asm ("movl %%ebx, %0\n" :"=r"(r_ebx));
As a result, I get the following:
mov %eax,%eax mov %eax,0x1944b8 mov 0x1944b8,%eax mov %ebx,%eax mov %eax,0x1944bc mov 0x1944bc,%eax
But I just need to:
mov %eax,0x1944b8 mov %ebx,0x1944bc
How can I achieve this result?
source share