![]() ![]() ![]() Hopefully, in another post I’ll go over the stack and frame in detail. When looking at the assembly the stack pointer and frame pointer are a large part of any program. However, to the trained eye you can spot some places the ARM assembly code is not optimal. The -O0 is crucial since it’s turns optimization off. ![]() This is done by simply running gcc -O0 -Wall -S if.c. We want to focus on where the variables are set, and especially where we have the if statements and variable a is compared to variable b. ARM Assembly of our if statementīelow is the ARM assembly from the C code above. The BEYONDIF label represents code outside the if statement and allows us to jump out when the if condition doesn’t hold. Mov r3, #4 the statements inside the if when true Cmp r2, r3 r2 = value of a, r3 = value of bīne BEYONDIF the branch is the opposite of = ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |