asm in c++

hi can anybody help me with this program

#include "iostream"
using namespace std;
int main()
{
asm {
mov ah,2h
mov cx,41
int 21h
}
return 0;
}
What exactly do you need help with?
in asm section the compiler errors (asm{...}
is there anything wrong with the code.
I think you need to do something like asm("assmebly code");


So in your case
1
2
3
4
5
6
7
8
9
asm("mov ah, 2h"\
"mov cx, 41"\
"int 21h");

or 

asm("mov ah, 2h"
"mov cx, 41"
"int 21h");


I don't know much about assembly but the error I get is Assembler messages: 7: Error: too many memory references for `mov' but could be because I was using online compiler.
no it's not for online compiler because i get the exact error too.
Topic archived. No new replies allowed.