; fopen.scr

structure param_blk fields
    env_seg (word,hex)
    args (dword,ptr)

intercept 21h
    function 3ch    ; Create File
        on_entry
            output "CREAT " (ds:dx->byte,asciiz,64)
        on_exit if (cflag == 1)
            sameline " [FAIL " ax "]"
    ; ----------------------------------------      
    function 3dh    ; Open File
        on_entry
            output "OPEN  " (ds:dx->byte,asciiz,64)
        on_exit if (cflag == 1)
            sameline " [FAIL " ax "]"
    ; ----------------------------------------      
    function 4bh    ; Execute Program
        subfunction 00h
            on_entry
                output "EXEC  " 
                       (ds:dx->byte,asciiz,64)                 ; program
                       (es:bx->param_blk.args->byte,string,64) ; cmdline
            on_exit if (cflag == 1)
                sameline " [FAIL " ax "]"
    ; ----------------------------------------      
    function 4eh    ; Find First File
        on_entry
            output "FIND  " (ds:dx->byte,asciiz,64)
        on_exit if (cflag == 1)
            sameline " [FAIL " ax "]"
