summaryrefslogtreecommitdiff
path: root/template/template.c
diff options
context:
space:
mode:
Diffstat (limited to 'template/template.c')
-rw-r--r--template/template.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/template/template.c b/template/template.c
new file mode 100644
index 0000000..8237d68
--- /dev/null
+++ b/template/template.c
@@ -0,0 +1,30 @@
+#define CPU_FREQ 1843200
+
+__sfr __at 0x30 sio_a_data;
+__sfr __at 0x31 sio_b_data;
+__sfr __at 0x32 sio_a_ctrl;
+__sfr __at 0x33 sio_b_ctrl;
+
+void putchar(char c)
+{
+ unsigned char ctrl = 0;
+
+ sio_a_data = c;
+
+ while (!(ctrl & 0x04)) {
+ sio_a_ctrl = ctrl;
+ ctrl = sio_a_ctrl;
+ }
+}
+
+void print(const char *str)
+{
+ for (; *str; str++)
+ putchar(*str);
+}
+
+int main()
+{
+ print("Hello World from C");
+ return 0;
+}