Answer the question
In order to leave comments, you need to log in
How to solve problem with inserting asm in c++ code blocks?
I'm trying to build a program in Code Blocks (17.12) , it gives an error error: '_asm' was not declared in this scope
The program code itself
#include <iostream>
using namespace std;
int main()
{
setlocale(0,"RUS");
char b[] = {"abcdef"};
_asm
{
mov ecx,6
lea edx,b[0]
oncemore:
add [edx],3
add edx,1
loop oncemore
}
cout<<b<<endl;
system("pause");
return 0;
}
Answer the question
In order to leave comments, you need to log in
Correct syntax:
asm( // Внимание на скобку!
"Строка, содержащая твой код"
);
asm(R"(
mov ecx,6
lea edx,b[0]
oncemore:
add [edx],3
add edx,1
loop oncemore
)");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question