Random good picture Not show
1. For example, B5 refers to test eax,eax.
2. The service code is present in the EAX register.
3. It returns the menu handle in eax if successful.
3. Sentencedict.com try its best to gather and make good sentences.
4. The next line, C3, takes the pointer in eax and stores it back into the instance reference at memory location 049388C8.
5. While lodsl modifies %eax, the lodsl and stosl instructions use it implicitly.
6. That is, if eax has to be used, it should be used as %eax.
7. The CPU chooses the AL, AX, or EAX register depending on the width of the operand (8, 16, or 32 bits).
8. If the contents of the AL/AX/EAX register matches that of operand 1, then the contents of operand 2 are copied to the first; otherwise, the AL/AX/EAX register is updated with the value of operand 2.
9. Thus %eax serves here as both input and output register.
10. In the following example, the cpuid instruction takes the input in the %eax register and gives output in four registers: %eax, %ebx, %ecx, %edx.
11. 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.
12. Unless this is done, GCC assumes that %eax and %ecx are free, and it may decide to use them for storing other data.
13. And since %eax is specified in the clobbered list, GCC doesn't use it anywhere else to store data.
14. 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).
15. This is a 5-byte instruction, with MOV EAX opcode as the first byte and the service index as remaining 4 bytes.
16. The input to cpuid (the variable "op") is passed to "asm" in the eax register, as cpuid expects it to.
17. Pointer, class, class - reference, and procedure - pointer results are returned in EAX.
18. The code at BE allocates the memory from the heap for the Singleton object and stores a pointer to that memory in eax.
19. All stubs from ntdll.dll start with the line MOV EAX, ServiceIndex, which applies to any version and flavour of Windows NT.
20. After a few simple tests, the actual system call is invoked using the system_call_table and index contained in eax.
21. The first two lines of assembly code at B0 and B5 load the instance reference from memory location 049388C8 into eax and test for null.