Re: Array elements



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>

.



Relevant Pages

  • Request for help
    ... double sasum(int n,double * sx,int incx); ... int isamax(int n, double *sx, int incx); ... void saxpy(int n,double sa, double *sx,int incx,double * sy,int incy); ... register double s; ...
    (comp.lang.c)
  • [PATCH] drm: Allow platform devices to register as DRM devices
    ... unsigned int resource) ... after the initialization for driver customization. ... struct drm_file *file_priv) ... * then register the character device and inter module information. ...
    (Linux-Kernel)
  • [KVM PATCH v5 2/2] kvm: add iosignalfd support
    ... iosignalfd is a mechanism to register PIO/MMIO regions to trigger an eventfd ... Host userspace can register any arbitrary ... as well as latency to the signalling path. ... int kvm_irqfd; ...
    (Linux-Kernel)
  • [KVM PATCH v10 2/2] KVM: add ioeventfd support
    ... ioeventfd is a mechanism to register PIO/MMIO regions to trigger an eventfd ... Host userspace can register any ... Therefore, an IO in KVM traps from the guest to the host, causes a VMX/SVM ... int kvm_irqfd; ...
    (Linux-Kernel)
  • [PATCH 22/46] KVM: add ioeventfd support
    ... ioeventfd is a mechanism to register PIO/MMIO regions to trigger an eventfd ... Host userspace can register any ... Therefore, an IO in KVM traps from the guest to the host, causes a VMX/SVM ... int kvm_irqfd; ...
    (Linux-Kernel)