home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
progjour
/
1991
/
04
/
dos_errs.asm
< prev
next >
Wrap
Assembly Source File
|
1990-04-29
|
1KB
|
57 lines
title ms_dos_strerror - ms_dos interface that sets error string
include asm.inc
.data
error_strings dw err1,err2,err3,err4,err5,err6,err7,err8,err9,err10
dw err11,err12,err13,err14,err15,err16,err17,err18
err1 db 'Invalid function',0
err2 db 'File not found',0
err3 db 'Path not found',0
err4 db 'No handles left',0
err5 db 'Access denied',0
err6 db 'Invalid handle',0
err7 db 'Memory ctrl blks destroyed',0
err8 db 'Insufficient memory',0
err9 db 'Invalid memory blk adr',0
err10 db 'Invalid environment',0
err11 db 'Invalid format',0
err12 db 'Invalid access code',0
err13 db 'Invalid data',0
err14 db '?',0
err15 db 'Invalid drive',0
err16 db 'Deleting current dir',0
err17 db 'Not same device',0
err18 db 'No more files',0
MAX_ERROR_CODE equ 18
.code
extn ms_dos,set_strerror
public ms_dos_strerror
;; ms dos strerror
;
ms_dos_strerror proc
call ms_dos
jc mde1 ; if error during dos function
ret
mde1: push ax
cmp ax,MAX_ERROR_CODE
ja mde2 ; if error code too high
add ax,ax
jz mde2 ; if error code too low
xchg ax,si ; set error string
mov si,error_strings[bp+si-2]
xchg ax,si
call set_strerror
mde2: stc
pop ax
ret
ms_dos_strerror endp
end