asked on
int64 value;
asm {
mov ecx, edx
mov ebx, eax
add ebx, 1
adc ecx, 0
**************
here I need to store b and c in to 64 bit varriable value.
*************
}
ASKER
ASKER
ASKER
#define low(x) *(((unsigned int*)&(x))+0)
#define high(x) *(((unsigned int*)&(x))+1)
asm volatile ( "mov %0, %%edi \n"
"mov %1, %%eax \n"
"mov %2, %%edx \n"
"1: \n"
"mov %%edx, %%ecx\n"
"mov %%eax, %%ebx \n"
"add $1, %%ebx \n"
"adc $0, %%ecx \n"
"lock; cmpxchg8b %0\n"
"jnz 1b \n"
"mov %%edx, %%edx \n"
"mov %3, %%ebx \n" //Error
"mov %3, %%ecx \n" //Error
: "=m" (*in_value)
: "m" (low(*in_value)), "m" (high(*in_value)), "m" (*in_value)
: "memory", "ebx", "ecx", "eax", "edi");
if not this then alternative code snip will also work for me.
ASKER
Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.
TRUSTED BY
Open in new window