Re: Array elements
- From: Kenneth Brody <kenbrody@xxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 11:14:19 -0400
Richard Heathfield wrote:
[...]
[Cross-posted to comp.lang.c, and followups set to that group]
Kumar said:
How should I declare the array elements being half word?
That depends on what you mean by "half word". The word "word" is typically
used to describe a collection of bits that naturally fits into a register,
and this varies from machine to machine. The type normally given to such a
collection of bits, in C, is int. Whether a type half the size of an int
exists is up to the compiler writer.
On the KL-10 I used way back when, a "word" was 36 bits, and a "half
word" was (naturally) 18 bits. There were machine-code operators
for working with "half words". (For example, HLRS would move the
left [high-order] half-word of the source address to the "right"
[low-order] half-word of the destination, and sign-extend the
result.)
However, this was before I learned C, so I have no idea how this
would have been handled in C on that system. I also have no idea if
this has anything to do with the OP's use of the term "half word".
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>
.
- Prev by Date: Re: Using size_t clearly (appropriately?)
- Next by Date: Re: Problems with typedef
- Previous by thread: Re: Array elements
- Next by thread: which is faster?
- Index(es):
Relevant Pages
|