Subversion Repositories Kolibri OS

Rev

Rev 703 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 703 Rev 1075
Line 69... Line 69...
69
        push    ESI                     ; ...
69
        push    ESI                     ; ...
70
        push    EDI                     ; ...
70
        push    EDI                     ; ...
71
        push    EBP                     ; ...
71
        push    EBP                     ; ...
72
        sub     ESP,ENV_SIZE            ; make room for environment information
72
        sub     ESP,ENV_SIZE            ; make room for environment information
73
        mov     EBP,ESP                 ; point to buffer for 80x87 environment
73
        mov     EBP,ESP                 ; point to buffer for 80x87 environment
-
 
74
  ; Now EXC_NUM is located in [EBP+ENV_SIZE+32]
-
 
75
  ; but it isn't necessary to testing EXC_NUM,
-
 
76
  ; because only #MF is unmasked now
74
        fnstenv [EBP]                   ; get 80x87 environment
77
        fnstenv [EBP]                   ; get 80x87 environment
75
        fwait                           ; wait for 80x87
78
        fwait                           ; wait for 80x87
76
        mov     EDX,ENV_CW[EBP]         ; get control word
79
        mov     EDX,ENV_CW[EBP]         ; get control word
77
        not     EDX                     ; flip the mask bits
80
        not     EDX                     ; flip the mask bits
78
        mov     DH,0FFh                 ; turn on top byte
81
        mov     DH,0FFh                 ; turn on top byte
Line 122... Line 125...
122
          test  DL,ST_EF_ZD             ; - check for divide by zero
125
          test  DL,ST_EF_ZD             ; - check for divide by zero
123
          _quif e                       ; - quit if not divide by zero
126
          _quif e                       ; - quit if not divide by zero
124
          call  GetInf                  ; - process divide by zero
127
          call  GetInf                  ; - process divide by zero
125
          mov   CL,FPE_ZERODIVIDE       ; - indicate divide by zero
128
          mov   CL,FPE_ZERODIVIDE       ; - indicate divide by zero
126
        _endguess                       ; endguess
129
        _endguess                       ; endguess
-
 
130
   ; More correctly to rise this mask bit - is on end of __FPE_exception_
-
 
131
   ; but it may not returned at all...
-
 
132
        push    ECX
-
 
133
        mov     EAX, 68
-
 
134
        mov     EBX, 18                 ;
-
 
135
        mov     ECX, 16                 ; #MF
-
 
136
        mov     EDX, 1                  ; rise activity
-
 
137
        int     40h                     ; change state of signal activity
-
 
138
        pop     ECX
127
        _guess                          ; guess exception to be handled
139
        _guess                          ; guess exception to be handled
128
          cmp   CL,FPE_OK               ; - check if exception allowed
140
          cmp   CL,FPE_OK               ; - check if exception allowed
129
          _quif e                       ; - quit if exception not allowed
141
          _quif e                       ; - quit if exception not allowed
130
          movzx EAX,CL                  ; - set floating point status
142
          movzx EAX,CL                  ; - set floating point status
131
          call  __FPE_exception_        ; - call user's handler
143
          call  __FPE_exception_        ; - call user's handler
Line 142... Line 154...
142
        pop     ESI                     ; ...
154
        pop     ESI                     ; ...
143
        pop     EDX                     ; ...
155
        pop     EDX                     ; ...
144
        pop     ECX                     ; ...
156
        pop     ECX                     ; ...
145
        pop     EBX                     ; ...
157
        pop     EBX                     ; ...
146
        pop     EAX                     ; ...
158
        pop     EAX                     ; ...
147
        ret                             ; return from interrupt handler
159
        ret     4                       ; return from interrupt handler
-
 
160
                                        ; with removing EXC_NUM
Line 148... Line 161...
148
 
161
 
Line 149... Line 162...
149
endproc __FPEHandler_
162
endproc __FPEHandler_