同文件调用
程序编写
try0.s
.section .data
stro:
.asciz "hello wolrd"
.code32
.section .text
.global main
main:
call print
movl $1, %eax
movl $0, %ebx
int $0x80
print:
movl $4, %eax
movl $1, %ebx
movl $str0, %ecx
movl $11, %edx
int $0x80
ret
编译链接执行
跨文件调用
程序编写
try0.s
.code32
.section .text
.global main
main:
call print
movl $1, %eax
movl $0, %ebx
int $0x80
try1.s
.section .data
Str0:
.asciz "hello wolrd"
.code32
.section .text
.type print, @function
.global print
print:
movl $4, %eax
movl $1, %ebx
movl $Str0, %ecx
movl $11, %edx
int $0x80
ret
编译链接执行