struct / union in initializer, RFE #901.
[sdcc.git] / sdcc-extra / historygraphs / hello-z80 / hello.c
blobfd3276113655299f823361c935219d7e356b78e1
1 // Source by Philipp Krause under CC0 1.0
3 // A "Hello, World!"-Program. We use it to make the board
4 // output something that can not be mistaken for output
5 // From a benchmark.
7 // "Hello, world!" @ 115200 baud.
9 #include <stdint.h>
10 #include <stdio.h>
12 __sfr __at 0x00 Exec_port;
13 __sfr __at 0x01 StorOpc_port;
15 #if defined(__SDCC) && __SDCC_REVISION < 9624 // Old SDCC weirdness
16 void putchar (char c)
18 __asm
20 __endasm;
21 StorOpc_port = 0x1;
22 Exec_port = c;
23 __asm
25 __endasm;
27 #else // Standard C
28 int putchar (int c)
30 __asm
32 __endasm;
33 StorOpc_port = 0x1;
34 Exec_port = c;
35 __asm
37 __endasm;
38 return(c);
40 #endif
42 void main(void)
44 for (;;) {
45 printf("Hello, World!\n");