The modern C and C++ languages are often taken for granted for their simple syntax and compiler intuition. In Assembly, every variable and value are stored in registers, simple output lines are multiple statements in length, and a number can only be 0 to 9. Below I examine two different architectures, X86_64 and aarch64:
x86_64
The loop I have created that outputs Loop: number thirty times can be found here. Writing this was extremely difficult, constantly fighting a lack of good documentation and examples online. To write this code I viewed many examples online, wrote pseudo code, and wrote the program in C++ before beginning. Debugging was difficult as the errors given were vague or rididculous at times (no // style commenting comes to mind). The Visual Studio compiler for writing C or C++ for example, is alternatively much more informative and allows for easy: break points, live variable information, and detailed information on error codes. I dislike X86 for the limited amount of available registers but like it for it's simpler syntax.
aarch64
The loop previously mentioned can be found here. I found aarch64 harder to write because of it's complicated syntax and was very grateful I wrote the X86_64 code first as it was simply rewriting it. The debugging in aarch64 converesely is superb and actually offers suggestions on how to fix code (i.e. did you mean...?). aarch64 has many available registers however some syntax issues are strange as although x (register#) works in most cases it sometimes uses w (register#) for some lines. I found it not too time consuming to write this however I did get stuck on the division for a little while due to the unneccessarily complicated syntax.
In conclusion, for the amount of time it took to write in assembly the pros of smaller size and faster compile time are not worth the frustration of writing it. This lab however was an excellent experience for seeing how the compiler interprets code from higher level languages.
x86_64
The loop I have created that outputs Loop: number thirty times can be found here. Writing this was extremely difficult, constantly fighting a lack of good documentation and examples online. To write this code I viewed many examples online, wrote pseudo code, and wrote the program in C++ before beginning. Debugging was difficult as the errors given were vague or rididculous at times (no // style commenting comes to mind). The Visual Studio compiler for writing C or C++ for example, is alternatively much more informative and allows for easy: break points, live variable information, and detailed information on error codes. I dislike X86 for the limited amount of available registers but like it for it's simpler syntax.
aarch64
The loop previously mentioned can be found here. I found aarch64 harder to write because of it's complicated syntax and was very grateful I wrote the X86_64 code first as it was simply rewriting it. The debugging in aarch64 converesely is superb and actually offers suggestions on how to fix code (i.e. did you mean...?). aarch64 has many available registers however some syntax issues are strange as although x (register#) works in most cases it sometimes uses w (register#) for some lines. I found it not too time consuming to write this however I did get stuck on the division for a little while due to the unneccessarily complicated syntax.
In conclusion, for the amount of time it took to write in assembly the pros of smaller size and faster compile time are not worth the frustration of writing it. This lab however was an excellent experience for seeing how the compiler interprets code from higher level languages.
Comments
Post a Comment