
Originally Posted by
wysota
This is an assembler error, your assembly code is invalid.
Probably, you are saying right!
This is one of my program which is runned successfully;
#include <iostream>
using namespace std;
int a, b;
void f1(void)
{
a = 5;
b = 30;
asm
(
/*"movl $12, %ebx;"
"movl %ebx, a;"
"movl %ebx, b;"*/
"movl %eax, a;"
);
// cout<<"";
std::cout<<a<<std::endl;
std::cout<<b<<std::endl;
}
int main(){f1();}
#include <iostream>
using namespace std;
int a, b;
void f1(void)
{
a = 5;
b = 30;
asm
(
/*"movl $12, %ebx;"
"movl %ebx, a;"
"movl %ebx, b;"*/
"movl %eax, a;"
);
// cout<<"";
std::cout<<a<<std::endl;
std::cout<<b<<std::endl;
}
int main(){f1();}
To copy to clipboard, switch view to plain text mode
Thanks for your help & quick response.
But How a way I generate a interrupt no. 5 for print screen which doesn't take any input.
Bookmarks