source:
trunk/enter2.asm
| Last change on this file was 26, checked in by , 12 years ago | |
|---|---|
| File size: 372 bytes | |
| Line | |
|---|---|
| 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 | |
| 10 | spin: push busy |
| 11 | call printf |
| 12 | lock bts dword [ebx], 0 |
| 13 | jc spin |
| 14 | |
| 15 | leave ; mov esp,ebp / pop ebp |
| 16 | ret |
| 17 | |
| 18 | section .rodata |
| 19 | busy: db "Busy waiting!",10,0 |
Note:
See TracBrowser
for help on using the repository browser.