《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
364 B

  1. .code32
  2. SYSWRITE = 4 # sys_write()系统调用号
  3. .global mywrite
  4. .text
  5. mywrite:
  6. pushl %ebp
  7. movl %esp, %ebp
  8. pushl %ebx
  9. movl 8(%ebp),%ebx # ebx :文件描述符
  10. movl 12(%ebp),%ecx # ecx :缓冲区指针
  11. movl 16(%ebp),%edx # edx :显示字符数
  12. movl $SYSWRITE,%eax # eax :系统调用号
  13. int $0x80
  14. popl %ebx
  15. mov %ebp, %esp
  16. popl %ebp
  17. ret