code: 9ferno

ref: 6bb619c8db2867ddd9cd19c0aec05065f5ee0cae
dir: /lib9/lock-Nt-386.c/

View raw version
#include "lib9.h"

int
_tas(int *la)
{
	int v;

	_asm {
		mov eax, la
		mov ebx, 1
		xchg	ebx, [eax]
		mov	v, ebx
	}
	return v;
}