I'm very beginner in assembly language and trying to understand how these all work. My question may seem very dumb but anyway, it's not quite clear to me.
Consider the following simple program:
section .text
global _start
_start:
mov eax, [text]
mov [val], eax
mov ecx, val
mov eax, 4
mov edx, 7
mov ebx, 1
int 0x80
mov eax, 1
int 0x80
segment .bss
val resb 2
segment .data
text db "Th"
len equ $- text
Here we update values in registers and print it out with system call. But I'm wondering what if OS (I'm using Ubuntu 16.04) schedules some process on the same core. It means the process updates CPU registers in its own way. How does OS linux handle it? I mean each process has its own consistent registers value and not affected by some another process?