machine level code

  • 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.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s