I just started to learn x86 assembly and I tried to write a simple program that prints all the ascii characters and a line break to the standard output. It prints everything as expected except the line break and I can't figure out why. I compiled it with nasm on a 64 bit ubuntu operating system. Here is the code:
section .data
curr db ' '
section .text
global _start
_start:
next:
;print current character
mov eax,4
mov ebx,1
mov ecx,curr
mov edx,1
int 0x80
;check condition and increment curr
inc byte [curr]
cmp byte [curr],126
jle next
;new line and exit <--- doesn't work ???
mov eax,4
mov ebx,1
mov ecx,10
mov edx,1
int 0x80
mov eax,1
mov ebx,1
int 0x80