//---------------------------------------------------------------- // tryexec.s // // This program shows how you can directly invoke the Linux // 'sys_execve()' system-call to execute another executable // file which expects a command-line argument. // // assemble using: $ as tryexec.s -o tryexec.o // then link with: $ ld tryexec.o -o tryexec // // programmer: ALLAN CRUSE // written on: 26 APR 2005 //---------------------------------------------------------------- .equ sys_execve, 11 .data progname: .asciz "xmas" year: .asciz "1984" argv: .int progname, year, 0 .text _start: movl $sys_execve, %eax movl $progname, %ebx movl $argv, %ecx movl $0, %edx int $0x80 movl $1, %eax int $0x80 .global _start .end