I'd like to specify that I'm just getting started on assembly, so I really have 0 experience. Also, mine is just a curiosity, not asking because the program doesn't work or anything. My program is just some simple loop, but the thing I don't understand is, when I run it, it returns a value. That value is fine on its own, it's correct, but the issue is that I haven't used any system call to print anything.
The code is as follows:
global _start
section .text
_start:
mov ebx,1
mov ecx,4
label:
add ebx,ebx
dec ecx
cmp ecx,0
jg label
mov eax,1
int 0x80
As you can see, I'm just adding on ebx and decrementing ecx and at the end call sys_exit and interruption. All this is fine, but the thing is, like I said, that when I run the executable, it prints the value from ebx. Is this how it should be? And if it is, why? From what I've learned so far, I'd need to perform a system call to print a value, but here is not like this.