Subversion Repositories Kolibri OS

Rev

Rev 9057 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. int write_file(const char *path,const void *buff,
  3.                unsigned offset,unsigned count,unsigned *writes)
  4. {
  5.      int retval;
  6.      __asm__ __volatile__(
  7.      "pushl $0 \n\t"
  8.      "pushl $0 \n\t"
  9.      "movl %%eax, 1(%%esp) \n\t"
  10.      "pushl %%ebx \n\t"
  11.      "pushl %%edx \n\t"
  12.      "pushl $0 \n\t"
  13.      "pushl %%ecx \n\t"
  14.      "pushl $3 \n\t"
  15.      "movl %%esp, %%ebx \n\t"
  16.      "mov $70, %%eax \n\t"
  17.      "int $0x40 \n\t"
  18.      "testl %%esi, %%esi \n\t"
  19.      "jz 1f \n\t"
  20.      "movl %%ebx, (%%esi) \n\t"
  21. "1:"
  22.      "addl $28, %%esp \n\t"
  23.      :"=a" (retval)
  24.      :"a"(path),"b"(buff),"c"(offset),"d"(count),"S"(writes));
  25.   return retval;
  26. };
  27.