source: trunk/tsl.asm@ 11

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

Importazione sorgenti

File size: 456 bytes
Line 
1
2segment .text
3 global main
4extern printf
5
6main: mov eax, 0
7 call stampa
8 lock bts dword [x], 0
9 jc salta ; gia` settato
10 call stampa
11salta: lock bts dword [x], 0
12 jnc _end
13 call stampa
14 jmp _end
15
16stampa: 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
28segment .data
29x: dd 0
30
31segment .rodata
32fmt: db "Il valore di x e` %x",0x0a,0 ; 0x0a -> a capo
Note: See TracBrowser for help on using the repository browser.