x86/cpuid: replace magic number with named constant
[qemu.git] / tests / hello-i386.c
blobe00245d3fe99d8b41316a49260231f3c5c84475c
1 #include <asm/unistd.h>
3 extern inline volatile void exit(int status)
5 int __res;
6 __asm__ volatile ("movl %%ecx,%%ebx\n"\
7 "int $0x80" \
8 : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status)));
11 extern inline int write(int fd, const char * buf, int len)
13 int status;
14 __asm__ volatile ("pushl %%ebx\n"\
15 "movl %%esi,%%ebx\n"\
16 "int $0x80\n" \
17 "popl %%ebx\n"\
18 : "=a" (status) \
19 : "0" (__NR_write),"S" ((long)(fd)),"c" ((long)(buf)),"d" ((long)(len)));
22 void _start(void)
24 write(1, "Hello World\n", 12);
25 exit(0);