Calculate the absolute value of the difference between R0 and R1, put the result into R2, and try to write out its assembly language code.

  c++, question

Calculate the absolute value of the difference between R0 and R1, put the result into R2, and try to write out its assembly language code.

You can write the C code first, then compile with gcc to generate assembly files, remove some irrelevant content (mainly section information), and the rest is the assembly code you want. GCC can compile Intel-formatted assembly, AT&T-formatted assembly with an additional parameter.