summaryrefslogtreecommitdiff
path: root/bsp/x86/src/hello.c
blob: a075f18ef1c829e1ae6ae671843040579eca6d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#include <stdio.h>
const char* g_str = "Hello World!";

static int a = 1234;
int b = 5678;

extern void rt_kprintf(const char* fmt,...);

int add(int a, int b)
{
	return a+b;
}

int main(int argc, char* argv[])
{
	int i;
	char str[32] = "Hello World\n";

	for(i=0; i<argc; i++)
	{
		printf("argv[%d]='%s'\n", i, argv[i]);
	}

	printf(str);

	printf("g_str address is %ph\n",g_str);
	puts(g_str);

	rt_kprintf("\nnative rt_kprintf a(%ph)=%d, b(%ph)=%d\n", &a, a, &b, b);

	printf("%d+%d=%d\n", 4, 5, add(4, 5));

	return 0xdeadbeef;
}