
the system call are ready.The number identifying the write system call is put into the AL
register in line 13.
In line 14, we call the kernel to have the system executed.
Now we need to do an exit(0), because otherwise the code will start an infinite
loop. Since exit(0) only requires one argument that has to be 0, we decrease the BL reg-
ister (line 12), which still contains 1 (it was put there in line 8) with one byte and put
the exit system call number in AL (line 14). Finally, exit is called and the program should
terminate after the string “Hello, world!” is written to stdout. Let’s compile and execute
this assembly code to see if it works:
1 [root@gabriel]# ...