Skip to main content
5 of 13
Added x86 following comments
unseen_rider
  • 365
  • 1
  • 3
  • 8

3 questions on assembly - syntax, meaning, and equivalent C++ code

For the following example, using x86 code:

0x2000: cs cs cs
0x2001: xor x20,(eax)
0x2002: and x20,%ah
0x2003: or x20, %dh
0x2004: dec (ebi)
0x2005: dec %si
  1. What happens to the result after each step of code has been run?

  2. Does the order of the operands matter? If yes why?

  3. How do you construct some equivalent code (e.g. c++) from this assembly code?

This is not a homework question - I am new to assembly. Example code is not from actual code - it's to help me get a better understanding & illustrate my questions.

unseen_rider
  • 365
  • 1
  • 3
  • 8