about summary refs log tree commit diff stats
path: root/tests32/test01.c
blob: 3cf91ceb2cb6073fd0c9c80a2c5fd62a1e2dca42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <sys/syscall.h> 
#include <unistd.h>                                      
                                                                                
int main(int argc, char **argv)                                                 
{                                                                               
    const char msg[] = "Hello World!\n";
    //syscall(4, STDOUT_FILENO, msg, sizeof(msg)-1);
    asm (
        "movl $4, %%eax \n"
        "movl $1, %%ebx \n"
        "movl %0, %%ecx \n"
        "movl $13, %%edx \n"
        "int $0x80 \n"
    :
    :"r" (msg)
    :"%eax","%ebx","%ecx","%edx"
    );
    return 0;                                                                   
}