source: trunk/enter2.asm@ 25

Last change on this file since 25 was 2, checked in by Mattia Monga, 13 years ago

Importazione sorgenti

File size: 451 bytes
Line 
1section .text
2global enter_section
3extern printf
4
5enter_section:
6 enter 0, 0 ; 0 bytes of local stack space
7 mov ebx,[ebp+8] ; first parameter to function
8
9
10spin: mov ecx, 0
11 lock bts dword [ebx], 0
12 jc save
13print: push busy
14 call printf
15
16 cmp ecx, 1
17 je spin
18
19save: mov ecx, 1
20 jmp print
21
22 leave ; mov esp,ebp / pop ebp
23 ret
24
25section .rodata
26busy: db "Busy waiting!",10,0
Note: See TracBrowser for help on using the repository browser.