home *** CD-ROM | disk | FTP | other *** search
- include compiler.inc
- ttl FCLOSE, 1.05, 10-16-86, jwk
-
- ;close io stream
-
- dseg
- exterr
-
- cseg
- xtfs <close,$strhand>
-
- procdef fclose, <<stream, ptr>>
- pushreg
- pushds
- moverr 0
-
- callit $strhand <<stream,ptr>>
- inc ax
- jz ex ;bad pointer, ERR=0
- dec ax
-
- callit close,<<ax,reg>>
- or ax,ax ;returned NULL
- jz ok ;yes, okay
- ;
- seteof:
- moverr ax ;no, set error code
- mov ax,-1 ;and return EOF
- jmp short ex
- ;
- ok:
- ldptr si,stream
- xor ax,ax
- mov 4[si],al ;ERCD
- mov 3[si],al ;CRFLG
- mov 2[si],al ;MODE - not open
- dec ax
- mov [si],ax ;no UGC
- inc ax
- ex: pret
-
- pend fclose
-
- finish
-