An integer array that contains two 16bit elements is declare
An integer array that contains two 16-bit elements is declared as: unsigned integer idata[2]; The element idata[0] contains the value 0x1763 The element idata[1] contains the value 0x1519 The beginning memory address for the array is 0x100900C0. Indicate in hex, the contents of the memory byte at location 0x100900C2 and at location 0x100900C1 for a little endian memory system:
| Address | 8-Bit Content |
| 0x100900C2 | |
| 0x100900C1 |
Solution
Since the machine is little endian, last byte is stored as binary representation of the multibyte data-type is stored first.
Thus, for any value 0xABCD at location (say Memory address starting 100) we will have 100: CD & 101 : AB.
Here, memory storage for array will be :
| Memory Location | 8-Bit Content |
|---|---|
| 0x100900C0 | 63 |
| 0x100900C1 | 17 |
| 0x100900C2 | 19 |
| 0x100900C3 | 15 |
![An integer array that contains two 16-bit elements is declared as: unsigned integer idata[2]; The element idata[0] contains the value 0x1763 The element idata[1 An integer array that contains two 16-bit elements is declared as: unsigned integer idata[2]; The element idata[0] contains the value 0x1763 The element idata[1](/WebImages/2/an-integer-array-that-contains-two-16bit-elements-is-declare-970486-1761495911-0.webp)