Thus% eax serves here as both input and output register. 这样,这里的%eax既可以用作输入寄存器,又可以用作输出寄存器。
Unless this is done, GCC assumes that% eax and% ecx are free, and it may decide to use them for storing other data. 在完成这一步之前,GCC假设%eax和%ecx是自由的,它可能决定将它们用作存储其它的数据。
After a few simple tests, the actual system call is invoked using the system_call_table and index contained in eax. 在经过几个简单测试之后,使用systemcalltable和eax中包含的索引来执行真正的系统调用了。
The eax register is used to identify the particular system call that should be invoked, which is specified in the C library ( per the call from the user-space application). eax寄存器用来标识应当调用的某个系统调用,这在C库中做了指定(来自用户空间应用程序的每个调用)。
A value of1 ( for the Linux exit system call) is stored in EAX to request that the program exit. EAX中存储的值是1(代表Linuxexit系统调用),这请求程序退出。
And since% eax is specified in the clobbered list, GCC doesn't use it anywhere else to store data. 因为%eax是在修饰列表中指定的,GCC不在任何其它地方使用它来存储数据。
In the following example, the cpuid instruction takes the input in the% eax register and gives output in four registers:% eax,% ebx,% ecx,% edx. 在下面的示例中,cpuid指令采用%eax寄存器中的输入,然后在四个寄存器中给出输出:%eax、%ebx、%ecx、%edx。
But GCC won't know this unless we inform it, which is exactly what we do by including% eax and% ecx in the clobbered register set. 但GCC在我们通知它以前是不知道这些的,我们是通过将%eax和%ecx包括在修饰寄存器集中来通知GCC的。
That is, if eax has to be used, it should be used as% eax. 即,如果必须使用eax,它应该用作%eax。