_NFILE_  	EQU	20

_A_NORMAL	EQU	00h
_A_RDONLY	EQU	01h
_A_HIDDEN	EQU	02h
_A_SYSTEM	EQU	04h
_A_SUBDIR	EQU	10h
_A_ARCH		EQU	20h

_A_TEMPORARY    EQU	0100h
_A_DELETE       EQU	0400h
_A_SEQSCAN      EQU	0800h
_A_RANDOM	EQU	1000h

FH_OPEN		EQU	01h
FH_EOF		EQU	02h
FH_CRLF		EQU	04h
FH_PIPE		EQU	08h
FH_APPEND	EQU	20h
FH_DEVICE	EQU	40h
FH_TEXT		EQU	80h

A_OPEN	 	EQU	0001h
A_TRUNC	 	EQU	0002h
A_CREATE	EQU	0010h

M_RDONLY	EQU	0000h
M_WRONLY	EQU	0001h
M_RDWR		EQU	0002h

SEEK_SET    	EQU	0
SEEK_CUR    	EQU	1
SEEK_END    	EQU	2

DEV_UNKNOWN   	EQU	0000h
DEV_DISK      	EQU	0001h
DEV_CHAR      	EQU	0002h
DEV_PIPE      	EQU	0003h
DEV_REMOTE    	EQU	8000h

GLOBAL	_osfile:	BYTE
GLOBAL	_nfile:		WORD

GLOBALN	@dosmaper

GLOBALC	open,		:DPTR, :WORD, :DPTR
GLOBALC	sopen,		:DPTR, :WORD, :WORD, :DPTR
GLOBALP	creat,		:DPTR, :WORD
GLOBALP	close,		:WORD
GLOBALP	read,		:WORD, :DWORD, :WORD
GLOBALP	write,		:WORD, :DWORD, :WORD
GLOBALP	lseek,		:WORD, :DWORD, :WORD
GLOBALP	access,		:DPTR, :WORD
GLOBALP	remove,		:DPTR
GLOBALP	rename,		:DPTR, :DPTR
GLOBALP	chsize,		:WORD, :DWORD
GLOBALP	setmode,	:WORD, :WORD
GLOBALP	filelength,	:WORD
GLOBALP	tell,		:WORD
GLOBALP	setfdate,	:WORD, :WORD, :WORD
GLOBALP	setfattr,	:DPTR, :WORD
GLOBALP	readword,	:DPTR
GLOBALP	dosmaperr,	:WORD
GLOBALP	osftype,	:WORD
GLOBALP	osfiletype,	:WORD
GLOBALP	osisatty,	:WORD
GLOBALP	osopen,		:DPTR, :WORD, :WORD, :WORD
GLOBALP	osread,		:WORD, :DPTR, :WORD
GLOBALP	oswrite,	:WORD, :DPTR, :WORD
GLOBALP	oschsize,	:WORD, :DWORD
GLOBALP	removefile,	:DWORD
GLOBALP	isatty,		:WORD
GLOBALP	_dup,		:WORD
GLOBALP	dup2,		:WORD, :WORD
