<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+/* ekg_sys.h
+ * Various niceties for programming.
+ */
+
 #define GET_CYCLES(x) do { \
   unsigned lo, hi; \
   __asm__ __volatile(&quot;.byte 0x0f, 0x31&quot; : &quot;=a&quot;(lo), &quot;=d&quot;(hi)); \
@@ -74,7 +78,25 @@ inline uint8_t bin2hex(char lt[256][2], char * destination, uint8_t * source, un
     destination[pos+1] = lt[source[i]][1];
     i++, pos += 2;
   }
-  return 1;
+  return pos-1;
+}
+
+/* Allocating 
+ * ONLY USE IF YOU'RE NOT LOOPING OVER THIS FUNCTION!
+ */
+/* Params are Lookup Table, destination, source, and size of INPUT data */
+inline uint8_t abin2hex(char * destination, uint8_t * source, unsigned int size)
+{
+  unsigned int i = 0;
+  unsigned int pos = 0;
+  char lt[256][2];
+  bin2hex_init(lt);
+  while(i &lt; size) {
+    destination[pos] = lt[source[i]][0];
+    destination[pos+1] = lt[source[i]][1];
+    i++, pos += 2;
+  }
+  return pos-1;
 }
 
 /* ------------------------------------------------------------------- */</diff>
      <filename>code/c/common/ekg_sys.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bfd46bac7d7eaf3d15c7e88862d9c2f3c331d788</id>
    </parent>
  </parents>
  <author>
    <name>ekgregg</name>
    <email>ekgregg@tycho.ncsc.mil</email>
  </author>
  <url>http://github.com/hank/life/commit/578f84490337451d4e00f9cfe205c3cb52131cae</url>
  <id>578f84490337451d4e00f9cfe205c3cb52131cae</id>
  <committed-date>2009-10-05T15:33:47-07:00</committed-date>
  <authored-date>2009-10-05T15:33:47-07:00</authored-date>
  <message>Yea yeah</message>
  <tree>6bc37442272fcd0dff4cb0571180cdcacf5fb840</tree>
  <committer>
    <name>ekgregg</name>
    <email>ekgregg@tycho.ncsc.mil</email>
  </committer>
</commit>
