【2014-11-22】《The Hardware/Software Interface》– Section 4

  1. Moving Data: IA32
    • movx Source, Dest
    • x is one of {b(1-byte), w(2-byte), l(4-byte)}
    • Operand Types
      • Immediate: Constant integer data
        • Example: $0x400, $-533
        • Like C constant, but prefixed with‘$’
      • Register; one of 8 integer registers
        • Example: %eax, %edx
        • But %esp and %ebp reserved for special use
      • Memory: 4 consecutive bytes of memory at address given by register
        • Simplest example: (%eax)
        • Various other “address modes”
  2. Memory Addressing Modes: Basic
    1. Indirect (R) Mem[Reg[R]]
    2. Displacement D(R) Mem[Reg[R]+D]
  3. Conditionals and Control Flow
  4. Loops
  5. Switch Statements
时间: 2024-08-03 23:40:13

【2014-11-22】《The Hardware/Software Interface》– Section 4的相关文章

【2014-11-23】《The Hardware/Software Interface》– Section 11

Data in Java Java has pointers – they are called 'referenes' Null is typically represented as 0 Characters and strings Two-byte Unicode instead of ASCII Represents most of the world's alphabets String not bounded by a '\0'(null character) Bounded by

【2014-11-22】《The Hardware/Software Interface》– Section 3

The time required to execute a program depends on: The program The compiler The instruction set architecture(ISA) The hardware implementation The ISA defines: The system's state(e.g. registers, memory, program counter) The instrutions the CPU can exe

【2014-11-21】《The Hardware/Software Interface》– Section 1

There are a fixed number of registers in the CPU Registers hold data Data move from Memory to Registers Results move from Registers back to Memory There is an 1-cache in the CPU that holds recently fetched instructions. If you execute a loop that fit

【2014-11-21】《The Hardware/Software Interface》– Section 2

printf("Signed Max:%d\n", 0x7FFFFFFF); printf("Signed Min:%d\n", 0x80000000); printf("Unsigned Max:%u\n", 0xFFFFFFFF); printf("Unsigned Min:%u\n", 0x00000000); By default are considered to be signed integers. Use &q

【2014-11-22】《The Hardware/Software Interface》– Section 5

Stack-Based Languages Need some place to store state of each instantiation(实例) Arguments Local variables Return pointer

【2014-11-22】《The Hardware/Software Interface》– Section 6

Buffer Overflows IA32 Linux Memory Layout Stack Runtime stack (8MB limit) Heap Dynamically allocated storage Allocated by malloc(), calloc(), new() Data Statically allocated data Read-only: string literals Read/write: global arrays and variables Text

【2014-11-23】《The Hardware/Software Interface》– Section 10

The malloc package void* malloc(size_t size) void free (void *p) other functions calloc: Version of malloc that initializes allocated block to zero realloc: Changes the size of a previously allocated block abrk: Used internally by allocators to grow

【2014-11-23】《The Hardware/Software Interface》– Section 7

Cache Definition: computer memory with short access time used for the storage of frequently or recently used instructions or data(i-cachhe and d-cache). more generally, used to optimize data transfers between system elements with different characteri

【2014-11-23】《The Hardware/Software Interface》– Section 8 (continue)

Exceptions: An exception is transfer of control to the operating system in response to some event. exception processing by exception handler Process(进程) Process abstraction provides an interface between the program and the underlying CPU + Memory. De