|
Last change
on this file since 12 was 2, checked in by Mattia Monga, 15 years ago |
|
Importazione sorgenti
|
|
File size:
456 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | segment .text
|
|---|
| 3 | global main
|
|---|
| 4 | extern printf
|
|---|
| 5 |
|
|---|
| 6 | main: mov eax, 0
|
|---|
| 7 | call stampa
|
|---|
| 8 | lock bts dword [x], 0
|
|---|
| 9 | jc salta ; gia` settato
|
|---|
| 10 | call stampa
|
|---|
| 11 | salta: lock bts dword [x], 0
|
|---|
| 12 | jnc _end
|
|---|
| 13 | call stampa
|
|---|
| 14 | jmp _end
|
|---|
| 15 |
|
|---|
| 16 | stampa: push dword [x]
|
|---|
| 17 | push dword fmt
|
|---|
| 18 | call printf
|
|---|
| 19 | add esp, 8
|
|---|
| 20 | ret
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | _end: mov eax, 1 ; call syscall exit
|
|---|
| 24 | xor ebx, ebx ; exit status 0
|
|---|
| 25 | int 0x80
|
|---|
| 26 | hlt
|
|---|
| 27 |
|
|---|
| 28 | segment .data
|
|---|
| 29 | x: dd 0
|
|---|
| 30 |
|
|---|
| 31 | segment .rodata
|
|---|
| 32 | fmt: db "Il valore di x e` %x",0x0a,0 ; 0x0a -> a capo
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.