Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
164 | serge | 1 | |
2 | |||
3 | reg_eflags equ ebp+12 |
||
4 | reg_esp equ ebp+16 |
||
5 | reg_ss equ ebp+20 |
||
6 | fpu_ctrl equ ebp-28 |
||
7 | |||
8 | align 4 |
||
9 | |||
10 | push ebp |
||
11 | mov ebp, esp |
||
12 | sub esp, 28 |
||
13 | |||
14 | push eax |
||
15 | |||
16 | push ecx |
||
17 | push edx |
||
18 | |||
19 | mov ebx, [ss:CURRENT_TASK] |
||
20 | |||
21 | |||
22 | mov eax, [ss:ebx+PROC_BASE+APPDATA.fpu_handler] |
||
23 | |||
24 | jz .default |
||
25 | |||
26 | mov ecx, [reg_eip] |
||
27 | |||
28 | sub edx, 4 |
||
29 | mov [ss:edx+new_app_base], ecx |
||
30 | mov [reg_esp], edx |
||
31 | mov dword [reg_eip], eax |
||
32 | |||
33 | pop edx |
||
34 | |||
35 | pop ebx |
||
36 | pop eax |
||
37 | |||
38 | leave |
||
39 | |||
40 | |||
41 | .default: |
||
42 | |||
43 | fnstenv [fpu_ctrl] |
||
44 | |||
45 | or word [fpu_ctrl], 0111111b |
||
46 | fldenv [fpu_ctrl] |
||
47 | |||
48 | pop edx |
||
49 | |||
50 | pop ebx |
||
51 | pop eax |
||
52 | |||
53 | leave |
||
54 | |||
55 | |||
56 | |||
57 | |||
58 | |||
59 | restore reg_eflags |
||
60 | restore reg_esp |
||
61 | restore reg_ss |
||
62 | restore fpu_ctrl |
||
63 |