From: <cap...@us...> - 2007-04-13 17:54:28
|
Revision: 46 http://svn.sourceforge.net/pearcolator/?rev=46&view=rev Author: captain5050 Date: 2007-04-13 10:54:29 -0700 (Fri, 13 Apr 2007) Log Message: ----------- X86 simple helloworld test Added Paths: ----------- tests/simple/x86/helloworld tests/simple/x86/helloworld.s Added: tests/simple/x86/helloworld =================================================================== (Binary files differ) Property changes on: tests/simple/x86/helloworld ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: tests/simple/x86/helloworld.s =================================================================== --- tests/simple/x86/helloworld.s (rev 0) +++ tests/simple/x86/helloworld.s 2007-04-13 17:54:29 UTC (rev 46) @@ -0,0 +1,27 @@ +.data # section declaration + +msg: + .string "Hello, world!\n" + len = . - msg # length of our dear string + +.text # section declaration + + # we must export the entry point to the ELF linker or + .global _start # loader. They conventionally recognize _start as their + # entry point. Use ld -e foo to override the default. + +_start: + +# write our string to stdout + + movl $len,%edx # third argument: message length + movl $msg,%ecx # second argument: pointer to message to write + movl $1,%ebx # first argument: file handle (stdout) + movl $4,%eax # system call number (sys_write) + int $0x80 # call kernel + +# and exit + + movl $0,%ebx # first argument: exit code + movl $1,%eax # system call number (sys_exit) + int $0x80 # call kernel This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |