1 minute read

  • eip: address in memory of next instruction
  • registers: some hold important addresses other used for temporary data
    • on 32-bit architecture 8 registers are used
    • 2 have special meaning:
      • Stack pointer: esp
      • frame pointer: ebp
    • others are general purpose for most part: eax,ebx,ecx,edx,edi,esi
    • either 32bit pointers (e??) or 16bit version (??)
    • e?x can also be accessed as 8bit pointer: ?h, ?l
    • example: eax, ax, ah, al
  • different notations: GAS (gnu assembly) is used here
  • instructions can have arguments(operands)
    • immediate/const
      • using $ notation: $0x1F
    • register
      • using value stored within an register
      • notation: %eax: use eax as value
    • memory
      • get value within some memory block
      • different notations:
        • (%eax): get value stored in memory refernced from eax
        • 0x123: get value from address 0x123
  • data movement:
    • move:
      • movl src, dst
      • movl $eax,$ebx:
    • push/pop from stack:
      • push src
      • pop dst
  • stack
    • grows downward: top element has lowest addr
    • convention: draw stack upside-down
    • esp: holds addr of top elem in stack
    • pushing dword:
      • decrementing esp by 4
      • push val into addr of esp

program  memory used for: object code, OS info, run-time stack for managing procedure calls and returns, and blocks of memory allocated by the user. addressed using virtual addresses.

 

 

Categories:

Updated: