Code: Select all
asm_proc_switch:
mov eax, [esp + 8]
mov [eax], ebx
mov [eax + 4], esi
mov [eax + 8], edi
mov [eax + 12], esp
mov [eax + 16], ebp
mov ecx, [esp]
mov [eax + 24], ecx
;; second half
mov eax, [esp + 4]
mov ebx, [eax]
mov esi, [eax + 4]
mov edi, [eax + 8]
mov esp, [eax + 12]
mov ebp, [eax + 16]
mov ecx, [eax + 24]
mov [esp], ecx
ret