/[gxemul]/upstream/0.3.4/doc/hello_ppc.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /upstream/0.3.4/doc/hello_ppc.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations)
Mon Oct 8 16:18:31 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 371 byte(s)
0.3.4
1 /* PPC Hello World for GXemul */
2
3 #define PUTCHAR_ADDRESS 0x10000000
4 #define HALT_ADDRESS 0x10000010
5
6 void printchar(char ch)
7 {
8 *((volatile unsigned char *) PUTCHAR_ADDRESS) = ch;
9 }
10
11 void halt(void)
12 {
13 *((volatile unsigned char *) HALT_ADDRESS) = 0;
14 }
15
16 void printstr(char *s)
17 {
18 while (*s)
19 printchar(*s++);
20 }
21
22 void f(void)
23 {
24 printstr("Hello world\n");
25 halt();
26 }

  ViewVC Help
Powered by ViewVC 1.1.26