Re: Questions about packed decimal and bit string data.
From: Robert Redelmeier (redelm_at_ev1.net.invalid)
Date: 12/27/03
- Next message: arargh312NOSPAM_at_NOW.AT.arargh.com: "Re: handling exceptions in msdos"
- Previous message: John H. Lindsay: "Questions about packed decimal and bit string data."
- In reply to: John H. Lindsay: "Questions about packed decimal and bit string data."
- Next in thread: John H. Lindsay: "Re: Questions about packed decimal and bit string data."
- Reply: John H. Lindsay: "Re: Questions about packed decimal and bit string data."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Dec 2003 23:02:32 +0000 (UTC)
John H. Lindsay <jlin_DELETE_THIS_SPAM_ZOT_dsay@kingston.net> wrote:
> (v) If a packed decimal number is stored from an FPU, are the
> bytes high-endian or low-endian within the resulting byte
x86 is little-endian. I sometimes format dumps to print
right-to-left to make numbers easier to recognize/decode.
x86 `fbld` and `fbst` instructions expect and deliver
[respectively] 80 bit values, 18 packed BCD digits and
sign as bit 79. Remainder of high byte ignored.
> Now how about bit strings? Suppose that in a 2-byte binary
> integer in bytes at addresses a and a+1 starting at bit 4
> of byte a. Does the bit string include bits 4, 5, 6 and 7 of
> a and bits 0, 1, 2, 3, 4, 5 and 6 of b, or does it include
> bits 4, 3, 2, 1 and 0 of a and bits 7, 6, 5, 4, 3 and 2 of
> byte a+1 or any of the other possibilities?
You can code anything you like. This bitpacking is
usually done to trade-off space for speed. You will
probably find the `shrd` and `shld` double-shift
instructions useful, but I don't know how fast they are
on modern CPUs.
> (3) I've gone through a number of books on x86 assemblers and
> I've never seen this sort of thing spelled out; are there
> any books that go to this level of detail? If so, which?
Not books, manuals. Intel releases a fine set at:
http://www.intel.com/design/pentium4/manuals/245470.htm
Books omit detail to make way for instruction and
hopefully insight. Manuals describe precisely what
is there, not how to use it.
Both can be failures or successes, but they have to
be judged by different standards.
-- Robert
- Next message: arargh312NOSPAM_at_NOW.AT.arargh.com: "Re: handling exceptions in msdos"
- Previous message: John H. Lindsay: "Questions about packed decimal and bit string data."
- In reply to: John H. Lindsay: "Questions about packed decimal and bit string data."
- Next in thread: John H. Lindsay: "Re: Questions about packed decimal and bit string data."
- Reply: John H. Lindsay: "Re: Questions about packed decimal and bit string data."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|