Skip to main content
GameDev.net gamedev.net
🔒 Locked

quick ASM question

Started by _Sigma Dec 6, 2005 at 11:01 PM 2 replies 850+ views
Original Post
_Sigma
_Sigma
Ok, i've been fiddling with some ASM code, and I still really suck at it :P but, what am I doing wrong here? Why doesn't this compile?
[source="cpp"]
int length = 0;
char names[10];

cout << "Enter your name:";
	cin >> names;

	length = strlen(names);
	length -= 3;
	
	__asm
	{

		mov ECX,length <- error on this line
		LEA EDI,names
	}


I am using VS 2005 pro. I get this compile error:

error C2400: inline assembler syntax error in 'second operand'; found 'newline'
Also, again probably a dumb question, how do I grab data from a register?

int blah;
__asm
{
MOV blah,EAX ; mov from eax to blah
}

Is that right? Anyways, thanks for the help, asm is pretty overwhelming!
_Sigma
_Sigma
hmmm. bizzare. would never have guess that! Cheers!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.