code: 9ferno

ref: a4b1891203255a9ba6df3c6b158300b6b758a577
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;
}