Category : Files from Magazines
Archive   : TINYLIB.ZIP
Filename : CREAT.ASM

 
Output of file : CREAT.ASM contained in archive : TINYLIB.ZIP
include compiler.inc
ttl CREAT, 1.03, 08/03/86, clr
;
;
; NAME: creat - create a new file
;
; Synopsis: int creat(fname)
; char *fname; ; file name to create
;
; Description: creat() creates a file and opens it for write-only access.
; If the file already exists, it is truncated so that nothing
; is in it. creat() returns as its value a file handle, which
; is used by other standard i/o functions. This handle is
; unique for each file opened or created. If creat() fails,
; it returns a -1, and sets the global error value.
;
;
;
dseg
exterr
cseg

procdef creat,<>

ldptr dx,fname,ds ;name pointer
xor ax,ax
moverr ax
xor cx,cx ;no attributes
mov ax,3C00h ;on new file
int 21h
jnb ex2 ;created OK

err:
moverr ax ;error
mov ax,-1

ex2:
pret
pend creat

finish


  3 Responses to “Category : Files from Magazines
Archive   : TINYLIB.ZIP
Filename : CREAT.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/