section .text global enter_section extern printf enter_section: enter 0, 0 ; 0 bytes of local stack space mov ebx,[ebp+8] ; first parameter to function spin: push busy call printf lock bts dword [ebx], 0 jc spin leave ; mov esp,ebp / pop ebp ret section .rodata busy: db "Busy waiting!",10,0