有一条汇编语句看不懂,大家过来看看啊!
这是一段进程发生上下文切换时,保存当前任务寄存器内容的一段汇编代码。原来的代码采用的是linux下的at&t格式的汇编风格,这里我将其改写成inter的格式。
Current指向一段缓冲区的起始地址,该缓冲区足够大。
其中,我标记“?”的语句,即mov [ebx + 136], 1fh,我不知道该语句的作用是什么,谁能够解释一下?
与该语句对应的原先的汇编(at&t格式)指令为:
movl $1f, 136(%%ebx),与其对应的注释为Store return address (current)
push ecx /* save ECX register's value */
mov ecx, Current
mov [ecx + 0], eax /* save eax's value */
mov [ecx + 4], ebp
mov [ecx + 8], edi
mov [ecx + 12], esi
mov [ecx + 16], edx
mov [ecx + 24], ebx
pushf
pop edx
mov [ecx + 152], edx /* 保存flag的值 */
mov ebx, ecx
pop ecx
mov [ebx + 20], ecx /* 保存原 ecx 的值 */
fsave [ebx + 28] /* store FPU 108 bytes */
/* 此时Current指向的缓冲区中的内容寄存器顺序为:
eax ebp edi esi edx ecx ebx FCPU...eflags */
mov [ebx + 136], 1fh /* ??? */
mov [ebx + 140], esp /* Store stack pointer (current) */