	
segment .text
	global main
extern printf

main:	mov eax, 0
	call stampa
	lock bts dword [x], 0
	jc salta  		; gia` settato
	call stampa
salta:	lock bts dword [x], 0
	jnc _end
	call stampa
	jmp _end

stampa:	push dword [x]	
	push dword fmt	
	call printf
	add esp, 8
	ret
	

_end:	mov eax, 1 		; call syscall exit
	xor ebx, ebx		; exit status 0
	int 0x80
	hlt

segment .data	
x:	dd 0

segment .rodata
fmt:	db "Il valore di x e` %x",0x0a,0 ; 0x0a -> a capo
