After much searching, I found that the only way to do inline assembly in dev-cpp is to do it like that, but there seems to be a problem with this code (which I didn't write, since I know almost nothing about assembly). The author of the book I reading says this code is equivalent to:Code:__asm
(
"CLD;"
"MOV EAX, color ;"
"MOV ECX, (SCREEN_WIDTH/2);"
"MOV EDI, video_buffer;"
"REP STOSD;"
);
But my compiler has problems with his assembly code:Code:for (DWORD ecx = 0, DWORD * edi = video_buffer; ecx< (SCREEN_WIDTH/2); ecx++)
edi[ecx] = color;
[quote]
c:\windows\TEMP/cclnyggb.s: Assembler messages:
c:\windows\TEMP/cclnyggb.s:647: Error: too many memory references for `mov'
c:\windows\TEMP/cclnyggb.s:647: Error: too many memory references for `mov'
c:\windows\TEMP/cclnyggb.s:647: Error: too many memory references for `mov'
c:\windows\TEMP/cclnyggb.s:647: Error: no such instruction: `STOSD
[/code]
Can any assembly programmers tell me whats wrong?