Hi all,

i just write an independent write function in assembly language to write a string to stderr.
But the code doesn't work on Solaris.  Below is the code:

void write_stderr ( char * buf, int n )
{
  int block[2];
  block[0] = (int) buf;
  block[1] = n;
  __asm__ volatile (
"pushl %%ebx\n" "movl %0, %%ebx\n" "pushl %%ebx\n" "movl 0(%%ebx), %%ecx\n"
     "movl  4(%%ebx), %%edx\n"
"movl $4, %%eax\n" "movl $2, %%ebx\n" "int $0x91\n" "popl %%ebx\n" "movl %%eax, 0(%%ebx)\n" "popl %%ebx\n" : /*wr*/
     : /*rd*/    "g" (block)
     : /*trash*/ "eax", "edi", "ecx", "edx", "memory", "cc"
  );
}

Does anyone know where i am wrong?
Thank you!

Regards,
adam

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to