Guest User

Untitled

a guest
Jan 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1.  
  2. EAX, EDX, ECX, EBX, ESI, EDI, EBP, ESP, EIP
  3.  
  4.  
  5.  
  6. EAX - accumulator register
  7.  
  8. for performing calculations as well as storing return values from function calls
  9. many optimized instructions in x86 instruction set are designed to move data into and out of the EAX register and perform calculations on that data
  10. most basic operations like add, subtract, and compare are optimized to use the EAX register
  11. more specialized operations like multiplication or division can occur _only_ within the EAX register
  12. you can easily determine if a function call has failed or succeeded based on the value stored in EAX
  13. you can determine the actual value of what the function is returning
  14.  
  15.  
  16. EBX - base register
  17.  
  18. extra storage, was not designed for anything in specific
  19.  
  20.  
  21. ECX - count register
  22. used for looping operations
  23. the repeated operations could be storing a string or counting numbers
  24. counts downward, not upward, for example in Python:
  25.  
  26. counter = 0
  27. while counter < 10:
  28. print "counter: %d", %counter
  29. counter += 1
  30.  
  31. translated to assembly ECX would equal 10 on the first loop, 9 on the second, and so on
  32. confusing because this is the opposite of what Python is showing
  33.  
  34.  
  35. EDX - data register
  36. basically an extension of the EAX register, assists in storing extra data for more complex calculations like multiplication and divison
  37. can also be used for general purpose storage but it is most commonly used in conjunction with calculations performed with EAX
  38.  
  39.  
  40.  
  41.  
  42. ESI - source index register
  43.  
  44. holds the location of the input stream
  45. used for reading
  46.  
  47.  
  48. EDI - destination index register
  49.  
  50. holds the location where the result of a data operation is stored
  51. used for writing
  52.  
  53.  
  54. ESI and EDI are used for loops that process data efficiently
  55.  
  56.  
  57.  
  58.  
  59. EIP - instruction pointer register
  60.  
  61. points to the current instruction that is being executed
  62. as the CPU moves through the binary code, EIP is updated to reflect the location where the execution is occuring
  63.  
  64.  
  65. ESP - stack pointer register
  66.  
  67. used for managing function calls and stack operations
  68. when a function is called the arguments to the function are pushed on to the stack and are followed by the return address
  69. the ESP points to the very top of the stack and so it will point to the return address
  70.  
  71.  
  72. EBP - base pointer register
  73.  
  74. used for managing function calls and stack operations
  75. used to point to the bottom of the call stack
  76. sometimes a compiler uses optimizations to remove the EBP register as a stack frame pointer
  77. sometimes the EBP register is freed up to be used like any other general purpose register
  78.  
  79.  
  80.  
  81. EFL - extended flags register
Add Comment
Please, Sign In to add comment