9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] BCD encoding in Plan9 - don't shoot me
@ 2016-02-12 17:44 Skip Tavakkolian
  0 siblings, 0 replies; 3+ messages in thread
From: Skip Tavakkolian @ 2016-02-12 17:44 UTC (permalink / raw)
  To: quanstro, 9fans

if i understand it correctly (reading wikipedia's description) the
field is either packed BCD (each nibble is the binary representation
of the digit) or ebcdic representation of the digits (see /sys/src/cmd/dd.c:618)

> So, I'm working with ISO8583,  a "standard" (HAHAHAH!!!!!)  The "standard"
> allows  but does not require, BCD encoding of numerical data. Which may or
> may not have a BCD-encoded numerical length prefix. The prefix may or may
> not be 1 to 3 bytes in length. Or the data might come with no prefix, and
> be right justified in a fixed width field of known size. Or left justified.
> So hard to tell these days.
>
> But I ramble. So I was just wanting to ask if anyone here has any simple
> BCD conversion routines.
>
> But, actually, ignore the subject line. Just shoot me.

/sys/src/9/pc/devrtc.c has an example of simple conversions, but given that standard,
i suppose simple is not what you're after.

- erik




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] BCD encoding in Plan9 - don't shoot me
  2016-02-10  1:02 Winston Kodogo
@ 2016-02-12 17:43 ` erik quanstrom
  0 siblings, 0 replies; 3+ messages in thread
From: erik quanstrom @ 2016-02-12 17:43 UTC (permalink / raw)
  To: 9fans

> So, I'm working with ISO8583,  a "standard" (HAHAHAH!!!!!)  The "standard"
> allows  but does not require, BCD encoding of numerical data. Which may or
> may not have a BCD-encoded numerical length prefix. The prefix may or may
> not be 1 to 3 bytes in length. Or the data might come with no prefix, and
> be right justified in a fixed width field of known size. Or left justified.
> So hard to tell these days.
>
> But I ramble. So I was just wanting to ask if anyone here has any simple
> BCD conversion routines.
>
> But, actually, ignore the subject line. Just shoot me.

/sys/src/9/pc/devrtc.c has an example of simple conversions, but given that standard,
i suppose simple is not what you're after.

- erik



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] BCD encoding in Plan9 - don't shoot me
@ 2016-02-10  1:02 Winston Kodogo
  2016-02-12 17:43 ` erik quanstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Winston Kodogo @ 2016-02-10  1:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

So, I'm working with ISO8583,  a "standard" (HAHAHAH!!!!!)  The "standard"
allows  but does not require, BCD encoding of numerical data. Which may or
may not have a BCD-encoded numerical length prefix. The prefix may or may
not be 1 to 3 bytes in length. Or the data might come with no prefix, and
be right justified in a fixed width field of known size. Or left justified.
So hard to tell these days.

But I ramble. So I was just wanting to ask if anyone here has any simple
BCD conversion routines.

But, actually, ignore the subject line. Just shoot me.

[-- Attachment #2: Type: text/html, Size: 770 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-12 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-12 17:44 [9fans] BCD encoding in Plan9 - don't shoot me Skip Tavakkolian
  -- strict thread matches above, loose matches on Subject: below --
2016-02-10  1:02 Winston Kodogo
2016-02-12 17:43 ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).