linux asm(nasm) output strings

来源:互联网 发布:网络主播套路 编辑:程序博客网 时间:2024/05/17 02:51
section .textglobal mainmain:mov eax,4mov ebx,1mov ecx,msgmov edx,lenint 80hmov eax,1int 80hmsg:db "hello world!it's too long!/n","$",'\r\n\t',0,'12345',lenlenequ $-msg
 nasm -f elf64 demo.asm
ld -emain demo.o -o demo
./demo
hello world!it's too long!/n$\r\n\t12345*
you see:
\r \n \t /n not useful

but

section .textglobal mainmain:mov eax,4mov ebx,1mov ecx,msgmov edx,lenint 80hmov eax,1int 80hmsg:db "hello world!",0xA,"it's too long!/n","$",'\r\n\t',0,'12345',len,0xalenequ $-msg
hello world!it's too long!/n$\r\n\t12345,

oxA -> '\n'




linux nasm-2.13.01 编译器