Metropoli BBS
VIEWER: dos.inc MODE: TEXT (ASCII)
ifndef __DOS_H__
__DOS_H__ equ 0

.code
int86 proto,i:byte,rin:dword,rout:dword
int86x proto,i:byte,rin:dword,rout:dword,sreg:dword
int386 proto,i:byte,rin:dword,rout:dword
int386x proto,i:byte,rin:dword,rout:dword,sreg:dword

open proto,strg:dword,acc:word
close proto,hand:word
creat proto,strg:dword,attr:word
read proto,hand:word,buf:dword,len:dword
write proto,hand:word,bur:dword,len:dword
lseek proto,hand:word,pos:dword,typ:byte   ;0=start  1=current  2=end
tell proto,hand:word
filelength proto,hand:word
eof proto,hand:word
ifndef __STDIO_H__
unlink proto,strg:dword
endif
getdisk proto
setdisk proto,drv:byte
mkdir proto,strg:dword
chdir proto,strg:dword
rmdir proto,strg:dword
rename proto,old:dword,new:dword
getcwd proto,buf:dword
getdcwd proto,drv:byte,buf:dword
findfirst proto,str1:dword,attr:word,ffb:dword
findnext proto,ffb:dword

gettime proto,:dword
settime proto,:dword
getdate proto,:dword
setdate proto,:dword

sleep proto,:word
delay proto,:word
sound proto,:word
nosound proto

.data
ffblk struct  ;used w/ findfirst & findnext
  ff_reserved db 21 dup (?)  ;reserved
  ff_attrib db ?
  ff_ftime dw ?
  ff_fdate dw ?
  ff_fsize dd ?
  ff_name db 13 dup (?)
ffblk ends

SEEK_SET equ 0  ; Seeks from beginning of file
SEEK_CUR equ 1  ; Seeks from current position
SEEK_END equ 2  ; Seeks from end of file

O_BINARY equ 0
O_RDONLY equ 0
O_WRONLY equ 1
O_RDWR equ 2
O_APPEND equ 0800h
O_CREAT equ 0100h
O_TRUNC equ 0200h
O_EXCL equ 0400h    ; Returns an error if file exists (O_CREAT)

FA_NORMAL equ  000h        ;/* Normal file, no attributes */
FA_RDONLY equ  001h        ;/* Read only attribute */
FA_HIDDEN equ  002h        ;/* Hidden file */
FA_SYSTEM equ  004h        ;/* System file */
FA_LABEL  equ  008h        ;/* Volume label */
FA_DIREC  equ  010h        ;/* Directory */
FA_ARCH   equ  020h        ;/* Archive */

BYTEREGS struct
  _al db ?
  _ah db ?
  _1 dw ?
  _bl db ?
  _bh db ?
  _2 dw ?
  _cl db ?
  _ch db ?
  _3 dw ?
  _dl db ?
  _dh db ?
  _4 dw ?
BYTEREGS ends

WORDREGS struct
  _ax dw ?
  _1 dw ?
  _bx dw ?
  _2 dw ?
  _cx dw ?
  _3 dw ?
  _dx dw ?
  _4 dw ?
  _si dw ?
  _5 dw ?
  _di dw ?
  _6 dw ?
  cflag dw ?
  _7 dw ?
WORDREGS ends

DWORDREGS struct
  _eax dd ?
  _ebx dd ?
  _ecx dd ?
  _edx dd ?
  _esi dd ?
  _edi dd ?
  cflag dd ?
DWORDREGS ends

REGS union
  d DWORDREGS <>
  w WORDREGS <>
  h BYTEREGS <>
REGS ends

; NOTE: int86x() & int386x()  ignore ss and cs
SREGS struct
  _es dw ?
  _cs dw ?
  _ss dw ?
  _ds dw ?
  _fs dw ?
  _gs dw ?
SREGS ends

date struct
  da_year dw ?;     /* current year */
  da_day db ? ;     /* day of the month */
  da_mon db ? ;     /* month (1 = Jan) */
date ends

time struct
  ti_min db ? ;   /* minutes */
  ti_hour db ?;  /* hours */
  ti_hund db ?;  /* hundredths of seconds */
  ti_sec db ? ;   /* seconds */
time ends

endif

[ RETURN TO DIRECTORY ]