0
Why "Compilation Error?" I used __asm!
I was planning to add 2 numbers and print the sums using __asm, but when I tried to do so, I got an error saying "Compilation error." I checked the code link, and saw that there are no white spaces (invalid ones, characters that has the dot in the middle and is highlighted in red). Could it be possible that the compiler doesn't support __asm? Or are there any errors in my code? https://code.sololearn.com/cFwVpPYbqT8I/?ref=app
5 Answers
+ 4
https://en.m.wikipedia.org/wiki/Calling_convention
+ 2
Bennett Post Should EAX be used for anything but return values of functions though? đ€
0
Thanks for your answers. Now when I changed the code to reflect changes, I got an error:
Assembler messages:
Error: junk '-84(%rbp)' after register
0
Thanks for your answer Bennett! I accidentally put string instead of int and forgot to put a comma between the operands in line 12 without being aware.
Now, I can make more programs that uses asm().
0
Thanks! I am going to make all of my further C++ and C codes use the inline assembly to do something. This is to show that SoloLearn supports ASM.
I hope they will add ASM lesson.