전체 글168 3.2.3 Notes on Formatting All of the lines beginning with ‘.’ are directives to guide the assembler and linker 3.3 Data Formats Due to its origins as a 16-bit architecture that expanded into a 32-bit one, Intel uses the term “word” to refer to a 16-bit data type. Based on this, they refer to 32- bit quantities as “double words,” and 64-bit quantities as “quad words 3.4 Accessing Information An x86-64 central processing u.. 2023. 4. 7. 3 Machine-Level Representation of Programs 3.2 Program Encodings higher levels of optimization (e.g., specified with the option -O1 or -O2) are considered a better choice in terms of the resulting program performance. the C preprocessor expands the source code to include any files specified with #include commands and to expand any macros, specified with #define declarations. Second, the compiler generates assembly- code versions of the t.. 2023. 4. 6. 2.2.8 Advice on Signed versus Unsigned We have seen multiple ways in which the subtle features of unsigned arith- metic, and especially the implicit conversion of signed to unsigned, can lead to errors or vulnerabilities. One way to avoid such bugs is to never use unsigned numbers 2.3 Integer Arithmetic Many beginning programmers are surprised to find that adding two positive num- bers can yield a negative result, and that the compar.. 2023. 4. 5. 2.2.5 Signed versus Unsigned in C Generally, most numbers are signed by default. For example, when declaring a constant such as 12345 or 0x1A2B, the value is considered signed. Adding character ‘U’ or ‘u’ as a suffix creates an unsigned constant; for example, 12345U or 0x1A2Bu. When printing numeric values with printf, the directives %d, %u, and %x are used to print a number as a signed decimal, an unsigned decimal, and in hexad.. 2023. 4. 4. 2.2.2 Unsigned Encodings 0 is nonnegative, this means that it can represent one less positive number than negative. Second, the maximum unsigned value is just over twice the maximum two’s-complement value: UMax = 2TMax + 1. Programmers who are concerned with maximizing portability across all possible machines should not assume any particular range of representable values, beyond the ranges indicated in Figure 2.11, nor .. 2023. 4. 2. 2.1.7 Bit-Level Operations in C one common use of bit-level operations is to implement masking operations, where a mask is a bit pattern that indicates a selected set of bits wihtin a word. 2.1.8 Logical Operations in C C also provides a set of logical operators ||,&& and !, which correspond to the OR, AND and NOT operations of logic. 2.1.9 Shift Operations in C Shift operations associate from left to right, so x 2023. 3. 31. 2.1.3 Addressing and byte Ordering These procedures use the C sizeof operator to determine the number of bytes used by the object. In general, the expression sizeof(T ) returns the number of bytes required to store an object of type T . Using sizeof rather than a fixed value is one step toward writing code that is portable across different machine types. 2.1.6 Introductino to Boolean Algebra Since binary values are at the core of.. 2023. 3. 30. 2 Representing and Manipulating Information 2.1 Information Storage Rather than accessing individual bits in memory, most computers use blocks of 8 bits, or bytes, as the smallest addressable unit of memory. The actual implementation (presented in Chapter 9) uses a combination of dynamic random access memory (DRAM), flash memory, disk storage, special hardware, and operating system software to provide the program with what appears to be a.. 2023. 3. 28. 1.9.2 Concurrency and Parallelism 1. Thread-Level Concurrency With threads, we can even have multiple control flows executing within a single process. most actual computing was done by a single processor, even if that processor had to switch among multiple tasks. This configuration is known as a uniprocessor system. Hyperthreading, sometimes called simultaneous multi-threading, is a technique that allows a single CPU to execute .. 2023. 3. 28. 1.5 Caches Matter 1.5 Caches Matter To deal with the processor-memory gap, system designers include smaller, faster storage devices called cache memories that serve as temporary staging areas for information that the processor is likely to need in the near future. The L1 and L2 caches are implemented with a hardware technology known as static random access memory(SRAM). 1.7 The Operating System Manages the Hardwa.. 2023. 3. 27. 이전 1 ··· 10 11 12 13 14 15 16 17 다음 728x90