2014-08-14 13:49:41 +00:00
|
|
|
; int pascal near __IOerror(int dosErr)
|
|
|
|
; int pascal near __DOSerror(int dosErr)
|
|
|
|
public __IOERROR
|
|
|
|
public __DOSERROR
|
|
|
|
|
|
|
|
__IOERROR proc near
|
|
|
|
@@dosErr = word ptr 4
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
mov dx, [bp+@@dosErr]
|
|
|
|
or dx, dx
|
|
|
|
jl short @@ser_maybeSVerr
|
2014-10-20 15:20:04 +00:00
|
|
|
cmp dx, e_dosFinalError
|
2014-08-14 13:49:41 +00:00
|
|
|
jle short @@ser_dosError
|
|
|
|
|
|
|
|
@@ser_errorFault:
|
2014-10-20 15:20:04 +00:00
|
|
|
mov dx, e_parameter
|
2014-08-14 13:49:41 +00:00
|
|
|
|
|
|
|
@@ser_dosError:
|
|
|
|
mov __doserrno, dx
|
|
|
|
mov bx, dx
|
|
|
|
mov al, __dosErrorToSV[bx]
|
|
|
|
cbw
|
|
|
|
mov dx, ax
|
|
|
|
jmp short @@ser_end
|
|
|
|
|
|
|
|
@@ser_maybeSVerr:
|
|
|
|
neg dx
|
|
|
|
cmp dx, __sys_nerr
|
|
|
|
jg short @@ser_errorFault
|
2014-10-20 15:20:04 +00:00
|
|
|
mov __doserrno, -1
|
2014-08-14 13:49:41 +00:00
|
|
|
|
|
|
|
@@ser_end:
|
2014-08-17 11:46:37 +00:00
|
|
|
mov _errno, dx
|
2014-10-20 15:20:04 +00:00
|
|
|
mov ax, -1
|
2014-08-14 13:49:41 +00:00
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
2014-10-20 15:20:04 +00:00
|
|
|
ret 2
|
2014-08-14 13:49:41 +00:00
|
|
|
__IOERROR endp
|
|
|
|
|
|
|
|
__DOSERROR proc near
|
|
|
|
@@dosErr = word ptr 4
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
push [bp+@@dosErr]
|
|
|
|
call __IOERROR
|
|
|
|
mov ax, [bp+@@dosErr]
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
2014-10-20 15:20:04 +00:00
|
|
|
ret 2
|
2014-08-14 13:49:41 +00:00
|
|
|
__DOSERROR endp
|