Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops

This task is to give an example of an exception handling routine
and to "throw" a new exception.



Related task

   Exceptions Through Nested Calls


;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: