summaryrefslogtreecommitdiffstats
path: root/Support_Libs/debug/debug.hcc
diff options
context:
space:
mode:
Diffstat (limited to 'Support_Libs/debug/debug.hcc')
-rw-r--r--Support_Libs/debug/debug.hcc33
1 files changed, 33 insertions, 0 deletions
diff --git a/Support_Libs/debug/debug.hcc b/Support_Libs/debug/debug.hcc
new file mode 100644
index 0000000..2cc6bef
--- /dev/null
+++ b/Support_Libs/debug/debug.hcc
@@ -0,0 +1,33 @@
+#include <stdlib.hch>
+
+#include "pal_master.hch"
+
+#include "debug.hch"
+
+void print_hex_value(unsigned value)
+{
+ unsigned 8 ch;
+ unsigned 4 i;
+ unsigned 32 tempvalue;
+
+ tempvalue = 0 @ value;
+
+ for(i = 0;i < 8;i++)
+ {
+ ch = 0 @ (tempvalue\\28);
+ tempvalue <<= 4;
+ ch += (ch > 9) ? 0x37 : 0x30;
+ PalDataPortWrite(PalRS232PortCT(0), ch);
+ }
+
+ PalDataPortWrite(PalRS232PortCT(0), 0x0A);
+ PalDataPortWrite(PalRS232PortCT(0), 0x0D);
+}
+
+void print_string(unsigned 8 s[16]) {
+ unsigned 4 i;
+
+ for(i = 0;('\0' != s[i]) || (0 < i);i++) {
+ PalDataPortWrite(PalRS232PortCT(0), s[i] +0x30);
+ }
+}