diff options
author | bellard | 2003-02-24 21:14:06 +0100 |
---|---|---|
committer | bellard | 2003-02-24 21:14:06 +0100 |
commit | 4d1135e486fcdd3b00caf524f01af7f0d56a0af7 (patch) | |
tree | c7d3c54bef5a20e8dc3890f75db8607c4531a24a /tests/hello.c | |
parent | added NO_TRACE_MSGS ifdef (diff) | |
download | qemu-4d1135e486fcdd3b00caf524f01af7f0d56a0af7.tar.gz qemu-4d1135e486fcdd3b00caf524f01af7f0d56a0af7.tar.xz qemu-4d1135e486fcdd3b00caf524f01af7f0d56a0af7.zip |
i386 emulator test
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@11 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests/hello.c')
-rw-r--r-- | tests/hello.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/hello.c b/tests/hello.c new file mode 100644 index 0000000000..89bd15b829 --- /dev/null +++ b/tests/hello.c @@ -0,0 +1,26 @@ +#include <asm/unistd.h> + +extern inline volatile void exit(int status) +{ + int __res; + __asm__ volatile ("movl %%ecx,%%ebx\n"\ + "int $0x80" \ + : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status))); +} + +extern inline int write(int fd, const char * buf, int len) +{ + int status; + __asm__ volatile ("pushl %%ebx\n"\ + "movl %%esi,%%ebx\n"\ + "int $0x80\n" \ + "popl %%ebx\n"\ + : "=a" (status) \ + : "0" (__NR_write),"S" ((long)(fd)),"c" ((long)(buf)),"d" ((long)(len))); +} + +void _startup(void) +{ + write(1, "Hello World\n", 12); + exit(0); +} |