Index: src/rs12/Makefile
===================================================================
--- src/rs12/Makefile	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/rs12/Makefile	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
@@ -0,0 +1,26 @@
+include ../../config.mak
+
+ifeq ($(BUILD_STATIC), yes)
+  LDFLAGS += -static
+endif
+
+LDFLAGS +=
+CFLAGS += -O2
+
+rs12: 
+	$(CC) $(CFLAGS) rs12.c -o rs12 $(LDFLAGS)
+
+.PHONY: install
+install:
+ifdef BIN_DIR
+	install -m 0755 rs12 $(BIN_DIR)
+endif
+
+.PHONY: uninstall
+uninstall:
+ifdef BIN_DIR
+	rm $(BIN_DIR)/rs12
+endif
+
+clean: 
+	rm rs12 || true
Index: src/rs12/rs12.c
===================================================================
--- src/rs12/rs12.c	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
+++ src/rs12/rs12.c	(revision 5f4d9c3b32eea7b6643a751aa75bdb05b7d41576)
@@ -0,0 +1,66 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
+#define MAXLINE 1000
+
+int main()
+{
+  char buf[MAXLINE];
+  char outbuf[MAXLINE];
+  char form[MAXLINE];
+  int len;
+  int curpos;
+  int nextpos=0;
+  int a;
+  int b;
+
+  while( fgets(buf, MAXLINE, stdin) )
+  {
+    int n = sscanf(buf, "%d %d", &a, &b);
+    if( 2 == n )
+    {
+      nextpos = a + b;
+      fputs(buf, stdout);
+    }
+    else
+    {
+      if( 1 == n )
+      {
+        curpos = a;
+        sscanf(buf, "%*d %*s %s", form);
+      }
+      else
+      {
+        curpos = nextpos;
+        sscanf(buf, "%*s %s", form);
+      }
+ 
+      if( '*' == *form )
+      {
+        len = 0;
+      }
+      else
+      {
+        char *f = form;
+        for( len = 0; *f; ++f )
+        {
+          if( '\\' != *f)
+          {
+            ++len;
+          }
+        }
+      }
+      
+      char *buf1 = buf;
+      while( !isalpha(*buf1) )
+      {
+        ++buf1;
+      }
+      sprintf(outbuf, "%04i %02i %s", curpos, len, buf1);
+      fputs(outbuf, stdout);
+      nextpos = curpos + len;
+    }   
+  }
+  return 0;
+}
