rfr1tz
asked on
What does this section of assembly code means?
Hi,
I got this section of assembly code:
#ifdef WIN32
inline int CPP_Spinlock::TestAndSet (int* pTargetAddress, int nValue)
{
__asm
{
mov edx, dword ptr [pTargetAddress]
mov eax, nValue
lock xchg eax, dwrod ptr[edx]
}
}
#endif
I tried to understand what this section of code really does? However, took the course on assembly code over 10 years ago and I don't remember much now. Please give some help.
Thanks a lot,
Rfr1tz
I got this section of assembly code:
#ifdef WIN32
inline int CPP_Spinlock::TestAndSet (int* pTargetAddress, int nValue)
{
__asm
{
mov edx, dword ptr [pTargetAddress]
mov eax, nValue
lock xchg eax, dwrod ptr[edx]
}
}
#endif
I tried to understand what this section of code really does? However, took the course on assembly code over 10 years ago and I don't remember much now. Please give some help.
Thanks a lot,
Rfr1tz
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.