Mail Archives: djgpp/1998/01/25/05:03:12
Hi I'm trying to make a little proggy in DJGPP, and I'm learning this
AT&T syntax... now the stuff doesn't work!! I think it should be easy
for you to see what I', doing wrong, the source is below..
The compile error is on the clobbering list, about 20 messages about
some numbers after the '%'.
If you know what's wrong, please help me... =)
--------------------------
#include <stdio.h>
unsigned char dbuffer[64000];
void smooth(unsigned char *bitmap)
{
//"smoothl:\n\t"
asm( "movb $0,%ah\n\t"
"movb -321(%edi),%al\n\t"
"addb -320(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb -319(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb -1(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb 1(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb 319(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb 320(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"addb 321(%edi),%al\n\t"
"adcb 0,%ah\n\t"
"shr %eax,3\n\t"
"movb (%edi),al\n\t"
"inc %edi\n\t"
"dec %ecx\n\t"
"jnz smoothl\n\t"
:
: "c"(63360), "a" (0), "D" (bitmap+320)
: "%eax", "%ebx", "%ecx", "%edx", "%edi");
}
int main()
{
smooth(&dbuffer);
return 0;
}
-------------------------------------------
- Raw text -