Ya I hesitated to post that as it was pretty hard to read.  You can
actually read the spec at http://www.fdms.com/specs.  It's the Visa
protocol.  Not that you would want to, but that's an easier way to see
it if you do.

What's really scary though is my original implementation of this from
9 years ago in perl that uses modems.