RosettaCodeData/Task/Exceptions/8086-Assembly/exceptions.8086

27 lines
577 B
Plaintext

;syscall for creating a new file.
mov dx,offset filename
mov cx,0
mov ah,5Bh
int 21h
;if error occurs, will return carry set and error code in ax
;Error code 03h = path not found
;Error code 04h = Too many open files
;Error code 05h = Access denied
;Error code 50h = File already exists
jnc noError ;continue with program
cmp ax,03h
je PathNotFoundError ;unimplemented exception handler
cmp ax,04h
je TooManyOpenFilesError
cmp ax,05h
je AccessDeniedError
cmp ax,50h
je FileAlreadyExistsError
noError: