1.18

Computer Systems A Programmer's Perspective  -Bryant O'Hallaron

Chapter 2. Representing and Manipulating Information

2.2.7 Truncating Numbers

2.2.8 Advice on Signed vs. Unsigned

2.3 Integer Arithmetic

2.3.1 Unsigned Addition

2.3.2 Two's Complement Addition

2.3.3 Two's Complement Negation

2.3.4 Unsigned Multiplication

2.3.5 Two's Complement Multiplication

  The bit-level representation of the product operation is identical for both unsigned and two's complement multiplication. The machine can use a single type of multiply instruction to multiply both signed and unsigned integers.

2.3.6 Multiplying by Constants

2.3.7 Dividing by Power of Two

2.3.8 Final Thoughts on Integer Arithmetic

2.4 Floating Point

2.4.1 Fractional Binary Numbers

2.4.2 IEEE Floating-Point Representation

2.4.3 Example Numbers

2.4.4 Round Numbers

2.4.5 Floating Point Operations

2.4.6 Floating Point in C

2.5 Summary

 

Chapter 3. Machine-Level Representation of Programs

 

Computer Systems A Programmer's Perspective  -Bryant O'Hallaron

Chapter 2. Representing and Manipulating Information

2.2.7 Truncating Numbers

2.2.8 Advice on Signed vs. Unsigned

2.3 Integer Arithmetic

2.3.1 Unsigned Addition

2.3.2 Two's Complement Addition

2.3.3 Two's Complement Negation

2.3.4 Unsigned Multiplication

2.3.5 Two's Complement Multiplication

  The bit-level representation of the product operation is identical for both unsigned and two's complement multiplication. The machine can use a single type of multiply instruction to multiply both signed and unsigned integers.

2.3.6 Multiplying by Constants

2.3.7 Dividing by Power of Two

2.3.8 Final Thoughts on Integer Arithmetic

2.4 Floating Point

2.4.1 Fractional Binary Numbers

2.4.2 IEEE Floating-Point Representation

2.4.3 Example Numbers

2.4.4 Round Numbers

2.4.5 Floating Point Operations

2.4.6 Floating Point in C

2.5 Summary

 

Chapter 3. Machine-Level Representation of Programs

3.1 A Historical Perspective

3.2 Program Encodings

  Object code is one form of machine code, it contains binary representations of all the instructions, but the addresses of global values are not yet filled in.

  The linker merges the object files along with code implementing library functions and generates the final executable file.

  Executable code is the second form of machine code, it is the exact form of code that is executed by a processor.

3.2.1 Machine-Level Code

  The format and behavior of a machine-level program is defined by the instruction set architecture or "ISA", defining the processor state, the format of the instructions, and the effect each of these instructions will have on the state.

  The memory addresses used by a machine-level program are virtual addresses, providing a memory model that appears to be a very large byte array.

  The assembly code representation is very close to machine code. It's main feature is that it is in a more readable textual format, as compared to the binary format of machine code.

  The program counter indicates the address in memory of the next instruction to be executed.

  The program memory contains the executable machine code for the program, some information required by the operating system, a run-time stack for managing procedure calls and returns, and block of memory allocated by user.

  The operating system manages the virtual address space, translating virtual addresses into the physical addresses of values in the actual processor memory.

3.2.2 Code Examples

  The disassembler can generate assembly code from machine code.

  Generating the actual executable code requires running a linker on the set of object code files, one of which must contain a function main.

3.2.3 Notes on Formatting

3.3 Data Formats

3.4 Accessing Information

3.4.1 Operand Specifiers

3.4.2 Data Movement Instructions

3.4.3 Data Movement Example

3.5 Arithmetic and Logical Operations

3.5.1 Load Effective Address

3.5.2 Unary and Binary Operations

3.5.3 Shift Operations

3.5.4 Discussion

3.5.5 Special Arithmetic Operations

3.6 Control

3.6.1 Condition Codes

 

posted @ 2019-01-19 10:09  lefthook  阅读(213)  评论(0编辑  收藏  举报