section .data ; data section, read-write
an: DD 0 ; this is a temporary var
string: db "the result is %s",10,0

section .text ; our code is always in the .text section
global main
extern printf ; tell linker that printf is defined elsewhere ; (not used in


main:
pop eax
pop eax
push string
call printf

proc_exit: ; exiting the program
mov eax, 1
int 80h





i try to print first argument in the command line, and i have a some problems:
1. the first value on the stack is not the number of arguments, i have to do pop once in order to get the number of arguments..
2. after i did pop once, i suppose to get to the arguments, but when i try to print the arguments, like you see in the program, it doesnt work, which means that first value in the stack after the number of parameters is not an argument ..

thanks a lot for whoever willing to help ..