]>
Commit | Line | Data |
---|---|---|
4d1135e4 FB |
1 | #include <asm/unistd.h> |
2 | ||
49cdaea1 | 3 | static inline void exit(int status) |
4d1135e4 FB |
4 | { |
5 | int __res; | |
6 | __asm__ volatile ("movl %%ecx,%%ebx\n"\ | |
7 | "int $0x80" \ | |
8 | : "=a" (__res) : "0" (__NR_exit),"c" ((long)(status))); | |
9 | } | |
10 | ||
4a6648f4 | 11 | static inline int write(int fd, const char * buf, int len) |
4d1135e4 FB |
12 | { |
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))); | |
49cdaea1 | 20 | return status; |
4d1135e4 FB |
21 | } |
22 | ||
bb326a37 | 23 | void _start(void) |
4d1135e4 FB |
24 | { |
25 | write(1, "Hello World\n", 12); | |
26 | exit(0); | |
27 | } |