+ 1

Why the following code cant able to produce the output??

I am working to learn c/c++ with assembly but the code not generate output ever I got errors ?? Help me to get out of this ??? https://code.sololearn.com/ciqSixXYrjX3/?ref=app

11th Jul 2019, 11:35 AM
Nouman Bin Sami
Nouman Bin Sami - avatar
5 Respuestas
+ 1
With some "cosmetic" changes required by GCC, you can do it! Here is your adapted code... https://code.sololearn.com/clpeBTRw26nz/?ref=app
11th Jul 2019, 1:08 PM
Bilbo Baggins
Bilbo Baggins - avatar
0
Where I can learned to code in cpp with assembly Bilbo Baggins and Paul because Bilbo your method is different and paul your method is different So, I think Im a little bit confused
12th Jul 2019, 3:58 AM
Nouman Bin Sami
Nouman Bin Sami - avatar
0
The beautiful of programming is that you can do the same thing in many ways, and you can choose the one that you like best. AT&T syntax, for GCC compilers, is the most classic way (https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html). Intel syntax is more common in Microsoft CL compilers (https://docs.microsoft.com/it-it/cpp/assembler/inline/writing-functions-with-inline-assembly?view=vs-2019). Happy coding!
12th Jul 2019, 5:12 AM
Bilbo Baggins
Bilbo Baggins - avatar
0
Thanks bro
12th Jul 2019, 5:14 AM
Nouman Bin Sami
Nouman Bin Sami - avatar
- 1
That's because you don't follow the inline Assembly syntax. You cannot directly use the c variables in assembly (plus, they most likely won't have the same name) Here is a working implementation: https://code.sololearn.com/cTT646osxyIN/?ref=app
11th Jul 2019, 12:04 PM
Paul