REP STOS Garbage
Posted: Sun Jun 10, 2012 12:21 am
Hello my friends,
While trying to optimize my memory operations code I've stumbled upon a problem.
I've converted my memory clear function to this
And since the only system that using this at the moment is ClearScreen, I immediately noticed that my screen is filled with green a's.
Any pointers?
EDIT: XOR EAX, EAX helped, but I still don't know the problem
While trying to optimize my memory operations code I've stumbled upon a problem.
I've converted my memory clear function to this
Code: Select all
__asm volatile("mov %0, %%edi":: "r"(Destination):"%edi");
__asm volatile("mov %0, %%eax":: "r"(0):"%eax");
__asm volatile("mov %0, %%ecx":: "r"(Count) :"%ecx");
__asm volatile("cld");
__asm volatile("rep stosb");
Any pointers?
EDIT: XOR EAX, EAX helped, but I still don't know the problem