source:
trunk/enter2.asm@
26
| Last change on this file since 26 was 26, checked in by , 12 years ago | |
|---|---|
| File size: 372 bytes | |
| Rev | Line | |
|---|---|---|
| [2] | 1 | section .text |
| 2 | global enter_section | |
| 3 | extern printf | |
| 4 | ||
| 5 | enter_section: | |
| 6 | enter 0, 0 ; 0 bytes of local stack space | |
| 7 | mov ebx,[ebp+8] ; first parameter to function | |
| 8 | ||
| 9 | ||
| [26] | 10 | spin: push busy |
| 11 | call printf | |
| [2] | 12 | lock bts dword [ebx], 0 |
| [26] | 13 | jc spin |
| [2] | 14 | |
| 15 | leave ; mov esp,ebp / pop ebp | |
| 16 | ret | |
| 17 | ||
| 18 | section .rodata | |
| [26] | 19 | busy: db "Busy waiting!",10,0 |
Note:
See TracBrowser
for help on using the repository browser.