I have been working on assembly on Debian mainly just experimenting. first with a simple hello world using printf and this worked with no problem. I then decided to try using system calls to replace the printf and this produced nothing. The code I used was written using AT&T syntax thus.
.bss #bss section of code follows below.
.data #data section.
outStr: .asciz "Hello World\n"
.global main
main:
pushq %rbp
movq %rsp, %rbp #refering to the stack pointer and the base pointer.
movq $1, %rax # system call number {sys write} #define __NR_write 1
movq $1, %rdi # What to do {stdout}
movq outStr, %rsi # message
movq $13, %rdx # message length
syscall # call linux kernel
movq $60, %rax # Setup the exit sys call #define __NR_exit 60
movq $0, %rdi # error code
syscall # call linux kernel
movq %rbp, %rsp # move base pointer back to stack pointer
popq %rbp # recover base pointer
ret
using strace I see this which seems to indicate a error. write(1, ox6f57206f6c6c6548, 13 = -1 {bad address} But I do not understand why.