Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc-extra / historygraphs / whetstone-z80 / portme.c
blobb420c17a7d0efec7ea22e0a1f5b9109fdd1a30dc
1 #include <stdio.h>
2 #include <stdint.h>
4 __sfr __at 0x00 Exec_port;
5 __sfr __at 0x01 StorOpc_port;
7 volatile unsigned long ticks;
9 void init (void)
11 // Setup tick interrupt.
12 StorOpc_port = 0x0f; // Set tick opcode
13 Exec_port = 10; // Once every 10 ms.
15 StorOpc_port = 0x0e; // Set interrupt opcode
16 Exec_port = 0x02; // Tick interrupt only.
18 __asm
19 im 1
21 __endasm;
24 void tick (void)
26 ticks++;
29 unsigned long clock(void)
31 long ret;
33 ret = ticks;
34 while (ret != ticks);
35 return(ret * 10);
38 #if defined(__SDCC) && __SDCC_REVISION < 9624 // Old SDCC weirdness
39 void putchar (char c)
41 __asm
43 __endasm;
44 StorOpc_port = 0x1;
45 Exec_port = c;
46 __asm
48 __endasm;
50 #else // Standard C
51 int putchar (int c)
53 __asm
55 __endasm;
56 StorOpc_port = 0x1;
57 Exec_port = c;
58 __asm
60 __endasm;
61 return(c);
63 #endif