os_kernel_lab/related_info/lab4/some-exercises/callee.s
2016-04-11 00:58:26 +08:00

18 lines
364 B
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.code32
SYSWRITE = 4 # sys_write()
.global mywrite
.text
mywrite:
pushl %ebp
movl %esp, %ebp
pushl %ebx
movl 8(%ebp),%ebx # ebx
movl 12(%ebp),%ecx # ecx
movl 16(%ebp),%edx # edx
movl $SYSWRITE,%eax # eax
int $0x80
popl %ebx
mov %ebp, %esp
popl %ebp
ret