All pastes #30628 Raw Edit

Someone

public text v1 · immutable
#30628 ·published 2005-11-23 17:16 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    unsigned int count = 10;
    char fill_value = 15;
    char *dest = malloc(512);
    asm ( "movl %0, %%ecx;\n"
	  "movl %2, %%esi;\n"
	  "loop: \n"
	  "movb %1, (%%esi)\n"
	  "inc %%esi\n"
	  "loopnz loop\n"
	:
	: "r" (count), "r" (fill_value), "r" (dest)
	: "%ecx", "%esi"
	);
	
	int index;
        for(index = 0; index < 16; index++)
	{
    	    printf("%d ",dest[index]);
        }

    getchar();
}