Imported slu/mmu/interrupt/register code from WIP memtester program into C template.
[pdp11-modern-c] / pdp11 / pdp11_slu.h
diff --git a/pdp11/pdp11_slu.h b/pdp11/pdp11_slu.h
new file mode 100644 (file)
index 0000000..9949360
--- /dev/null
@@ -0,0 +1,27 @@
+// (c) 2020 Aaron Taylor <ataylor at subgeniuskitty dot com>
+// See License.txt file for copyright and license details.
+
+#ifndef SGK_PDP11_SLU_H
+#define SGK_PDP11_SLU_H
+
+#include <stdint.h>
+#include "pdp11.h"
+
+/*
+ * Polled IO functions for default console port.
+ */
+void putch(uint16_t c);
+uint16_t getch(void);
+
+/*
+ * Simple printf function. Replaces:
+ *     %s - Print a string
+ *     %o - Print a uint16 in octal
+ *     \n - Print a newline suitable for this system ('\r\n')
+ *     \t - Print a tab
+ *     \% - Print a '%'
+ * Also converts existing newlines in the 'format' string to '\r\n'.
+ */
+void printf(const char * format, ...);
+
+#endif // SGK_PDP11_SLU_H