+ 14

Is it possible to use an assembly coding in a c++ code on Sololearn ?

Is it possible to use an assembly coding in a c++ code on Sololearn ? I know that is possible on a computer IDE but is that possible for Sololearn ? I have already try to use assembly coding in a c++ code but on Sololearn this create a lot of exception . May be the assembly code is different for Sololearn. This is the code what i have use: #include <iostream> using namespace std; int main() { asm { move eax, 10;//create a variable add eax, 10; //add 10 } cout<<eax; return 0; } Can you help me ?

9th Aug 2017, 7:41 AM
Lib Opensource
Lib Opensource - avatar
6 Answers
+ 13
yes you can. sololearn uses gcc. so use the following format __asm__ (/* assembly body */ ); https://code.sololearn.com/cwpJgrivL0Mk/?ref=app https://www.cs.uaf.edu/2012/fall/cs301/lecture/10_01_link_with_cpp.html
9th Aug 2017, 8:08 AM
jay
jay - avatar
+ 9
@jay, @Babak Sheykhan, thank you ^^
9th Aug 2017, 10:10 AM
Lib Opensource
Lib Opensource - avatar
+ 8
It supports AT&T assembly syntax. Try this: https://code.sololearn.com/c6TMOWzn7kC4/?ref=app
9th Aug 2017, 8:12 AM
Babak
Babak - avatar
+ 7
Ok, thank you for replying.
9th Aug 2017, 7:59 AM
Lib Opensource
Lib Opensource - avatar
+ 4
I have tried it on SL's ide too, it seems to not be supported unfortunately
9th Aug 2017, 7:50 AM
aklex
aklex - avatar
+ 4
@jay ty
9th Aug 2017, 8:12 AM
aklex
aklex - avatar