From: Howard Brazee on 22 Feb 2007 15:04 On Thu, 22 Feb 2007 12:51:05 -0700, Louis Krupp <lkrupp(a)pssw.nospam.com.invalid> wrote: >> The record matches the layout perfectly! >> Micro Focus S9(4) COMP is two bytes binary >> and 9V9(4) COMP is three bytes binary. >> >> >> > >How do you fit a sign and four digits into two bytes? (Or am I being >unusually dense today?) A byte holds 16 bits - 15 plus the sign. +9999d = 10011100001111b
From: Richard on 22 Feb 2007 15:06 On Feb 23, 8:51 am, Louis Krupp <lkr...(a)pssw.nospam.com.invalid> wrote: > > The record matches the layout perfectly! > > Micro Focus S9(4) COMP is two bytes binary > > and 9V9(4) COMP is three bytes binary. > > How do you fit a sign and four digits into two bytes? (Or am I being > unusually dense today?) In binary (as stated). The value in 16 bit can be -32368 to 32367 which is a larger range than -9999 to 9999. COMP (in this case) however is byte reversed compared to intel format being big-endian.
From: Rick Smith on 22 Feb 2007 15:35 "Richard" <riplin(a)Azonic.co.nz> wrote in message news:1172174815.695241.198480(a)l53g2000cwa.googlegroups.com... [snip] > In binary (as stated). The value in 16 bit can be -32368 to 32367 > which is a larger range than -9999 to 9999. Pedantically, the range is -32768 to +32767, which is the range that applies when the NOTRUNC compiler directive is used, as is true in the case of the record layout in question. [Important for any who may wish to write the requested program.]
From: William M. Klein on 22 Feb 2007 15:57 Also important that the NOIBMCOMP directive is in effect. This is important for why you can have 3 (or 1) byte binary fields. -- Bill Klein wmklein <at> ix.netcom.com "Rick Smith" <ricksmith(a)mfi.net> wrote in message news:12trvl1q5rqfp29(a)corp.supernews.com... > > "Richard" <riplin(a)Azonic.co.nz> wrote in message > news:1172174815.695241.198480(a)l53g2000cwa.googlegroups.com... > [snip] >> In binary (as stated). The value in 16 bit can be -32368 to 32367 >> which is a larger range than -9999 to 9999. > > Pedantically, the range is -32768 to +32767, which > is the range that applies when the NOTRUNC > compiler directive is used, as is true in the case > of the record layout in question. [Important for any > who may wish to write the requested program.] > > >
From: jacodeguy on 22 Feb 2007 16:00 On Feb 22, 2:06 pm, "Richard" <rip...(a)Azonic.co.nz> wrote: > On Feb 23, 8:51 am, Louis Krupp <lkr...(a)pssw.nospam.com.invalid> > wrote: > > > > The record matches the layout perfectly! > > > Micro Focus S9(4) COMP is two bytes binary > > > and 9V9(4) COMP is three bytes binary. > > > How do you fit a sign and four digits into two bytes? (Or am I being > > unusually dense today?) > > In binary (as stated). The value in 16 bit can be -32368 to 32367 > which is a larger range than -9999 to 9999. > > COMP (in this case) however is byte reversed compared to intel format > being big-endian. I have some printouts of what the sketch should look like, I cannot find the first record (pin 01-000-001-00), but I do have the second (pin 01-000-006-00). Based on looking at the printout, I think the first part should be like this: 01-000-006-00, A, -40, 16, 1, 11, 13, 33, 13, 49, 31, 49, 31, 53, 47, 53, 47, 27, 23, 27, 23, 33, 13, 33, 0, -2, C I can do, and would love too, but a little rusty. The bytes and strings I think I can get out, but I'm not sure about the S9(4) COMP (two bytes reversed) thing. if I have: byte *buffer; fread(buffer, 2, f); // lets pretened I just read a comp, you previously said: // "Just byte switch the COMP fields." // How would I do that? int x = (buffer[1] << 16) && buffer[0]; // something like this? -Andy
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: IBM Mainframe - Batch Job to Generate Data Set List? Next: How would you do this? |