Linux assembly comiled successfully

来源:互联网 发布:java saas架构设计 编辑:程序博客网 时间:2024/06/03 17:39
.datamsg:.string "hello,world!\n"len=.-msg.text.global _start_start:movl $len,%edxmovl $msg,%ecxmovl $1,%ebxmovl $4,%eaxint $0x80movl $0,%ebxmovl $1,%eaxint $0x80
as -o hello.o hello.s

as may only compile source file but not linked!

ld -s -o hello hello.o

./hello
hello,world!




0 0
原创粉丝点击