Consider a bit integer having a bit representation

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: For example, many programmers assume that a program object declared as type int can be used to store a pointer. This works fine for most 32-bit machines but leads to problems on an Alpha. 2.1.4 Addressing and Byte Ordering For program objects that span multiple bytes, we must establish two conventions: what will be the address of the object, and how will we order the bytes in memory. In virtually all machines, a multibyte object is stored as a contiguous sequence of bytes, with the address of the object given by the smallest address of the 2.1. INFORMATION STORAGE 27 bytes used. For example, suppose a variable x of type int has address 0x100, that is, the value of the address expression &x is 0x100. Then the four bytes of x would be stored in memory locations 0x100, 0x101, 0x102, and 0x103. For ordering the bytes representing an object, there are two common conventions. Consider a Û-bit integer having a bit representation ÜÛ ½ ÜÛ ¾ ܽ ܼ , where ÜÛ ½ is the most significant bit, and ܼ is the least. Assuming Û is a multiple of eight, these bits c...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online