Article 4W7HQ sys_write doesn't print a message to the terminal

sys_write doesn't print a message to the terminal

by
Sunless
from LinuxQuestions.org on (#4W7HQ)
Hi guys!

I'm trying to explore GNU Assembler using this example: https://0xax.github.io/asm_1/

My code of main.s is
Quote:
.data
message: .ascii "ASSEMBLY OUTPUT"

.text
.globl _start

_start:
movq $1, %rdi
movq $1, %rax
movq $15, %rdx
movq $message, %rsi
syscall
movq $60, %rax
movq $0, %rdi
syscall
Command line preparation:

Quote:
as -g -o main.o main.s

ld -o main main.o
Now, I run ./main But it doesn't print anything and terminal is waiting my next command.

What's going wrong?

In GNU Debugger numbers were successfully stored in registers.

I see result of first syscall "-14" in RAX.latest?d=yIl2AUoC8zA latest?i=CXbt8QmlQzw:jMuvL4TeeRo:F7zBnMy latest?i=CXbt8QmlQzw:jMuvL4TeeRo:V_sGLiP latest?d=qj6IDK7rITs latest?i=CXbt8QmlQzw:jMuvL4TeeRo:gIN9vFwCXbt8QmlQzw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments