I'm a newbie for Linux, for assembly programming (GAS) and for English. So, sorry if I write something wrong. I hope Google Translate will help me enough to write it all not too bad.
I want to know how to write a set of numbers, stored in section .data
, into the text file without calling functions from any libraries (like printf()
) and do this by assembler-only possibilities. I don't want ready-made solution. I want to know what Linux kernel does after my write call. How it works? How it designed?
I'm trying to print list of numbers into STDOUT, but I receive an odd sign in my terminal. I thought this occurs because I don't understand how to work with write system call correctly.
This is what I got for now
.section .data
list: .long 12, 31, 42
.section .text
.globl _start
_start:
movl $4, %eax
movl $1, %ebx
movl $list, %ecx
movl $12, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
This code works fine for .ascii "Hello world\0"
, but not for list of numbers.