Last change
on this file since 25 was 22, checked in by Mattia Monga, 11 years ago |
Chiamata di libreria vs. syscall
|
File size:
368 bytes
|
Rev | Line | |
---|
[21] | 1 | segment .text
|
---|
| 2 | global main
|
---|
[22] | 3 | extern printf
|
---|
[21] | 4 |
|
---|
[22] | 5 | main: push msg
|
---|
| 6 | call printf ; chiamata di libreria
|
---|
| 7 |
|
---|
| 8 | mov ecx, msg ; stringa
|
---|
[21] | 9 | mov edx, msg_size ; dimensione stringa
|
---|
| 10 | mov ebx, 1 ; file descriptor (stdout)
|
---|
| 11 | mov eax, 4 ; syscall 4 (write)
|
---|
| 12 | int 0x80
|
---|
| 13 |
|
---|
| 14 | mov eax, 1 ; syscall 1 (exit)
|
---|
| 15 | int 0x80
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | segment .rodata
|
---|
| 19 | msg db 'Ciao solabbisti!',10,0
|
---|
| 20 | msg_size equ $ - msg
|
---|
| 21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.