+ if (!crlf) return;
+ /* send CRLF */
+ while (!(_io_ports[M6811_SCSR] & M6811_TDRE));
+ _io_ports[M6811_SCDR] = '\r';
+ while (!(_io_ports[M6811_SCSR] & M6811_TDRE));
+ _io_ports[M6811_SCDR] = '\n';
+}
+
+void send_string(char* c) {
+ for (; *c; c++) {
+ while (!(_io_ports[M6811_SCSR] & M6811_TDRE)); /* wait for TX ready */
+ _io_ports[M6811_SCDR] = *c; /* send byte */
+ }
+}
+
+char toupper(char c) {
+ if (c >= 'a' && c <= 'z') c -= 'a'-'A';
+ return c;