In eax register, you’re loading the system call number (this example 0x1 = 1 = exit)
From ebx register on, you are loading all parameters to give to the sc.
In this case, in ebx you are loading the value 0x0 = 0 ? exit success.
The two ways are “quite” the same: maybe in this case you do not need for loading a singular value to ebx, but in general, when you’re calling a sc, you want the exact parameters.
So, when in ebx the already stored value (cause you just launched your application or an other set of instruction(s) put ebx to 0, the two codes performs the same sequence.
If not, the right way to do thinks is to use the first one.
[in this, I’m assuming you’re using intel assembly instructions]
```
mov ebx, 0x1
; some stuff which does not changes ebx
mov eax, 0x1 ; loading the sc number for exit
int 0x80
```
mov ebx, 0x1
; some stuff which does not changes ebx
mov eax, 0x1 ; loading the sc number for exit
mov ebx, 0x0 ; exit successful, so the arg for exit is 0
int 0x80
Try to create these two codes (let’s call them code1.asm and code2.asm)
If you compile, link and launch the two executables obtained in an environment (maybe a debugger) which tells you with which status they exits, the second one will not generate any type of warn/error, cause the call of exit(0) tells to the system “all ok, all good. no problems here!”; while the first one will raise something saying you that the executable 1 exited with an error status.