source:
trunk/esercizio.asm
| Last change on this file was 2, checked in by , 15 years ago | |
|---|---|
| File size: 362 bytes | |
| Rev | Line | |
|---|---|---|
| [2] | 1 | ;; uguale all'esame..... |
| 2 | ||
| 3 | segment .text | |
| 4 | global main | |
| 5 | extern printf,exit | |
| 6 | ||
| 7 | main: push dword 3 | |
| 8 | push dword 5 | |
| 9 | mov ebp,esp | |
| 10 | mov eax,[esp] | |
| 11 | mov ebx,[ebp] | |
| 12 | add eax, ebx | |
| 13 | add esp, 4 | |
| 14 | mov ebx,[esp] | |
| 15 | push ebx | |
| 16 | push eax | |
| 17 | push dword format | |
| 18 | call printf | |
| 19 | add esp, 4*3 | |
| 20 | push dword 0 | |
| 21 | call exit | |
| 22 | hlt | |
| 23 | ||
| 24 | segment .rodata | |
| 25 | format: db "EAX %d, EBX %d",0x0a,0 ; 0x0a -> a capo | |
| 26 | ||
| 27 |
Note:
See TracBrowser
for help on using the repository browser.