Reference Section
_close_h {
int handle;
char pathname[50];
...
handle = _create_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
... /* if successful */
close_h ();
jc main_010/* if an error occurred */
... /* if successful */
jmp short main_020
main_010:
... /* handle the error */
main_020:
...
}
Source file _FIOCLOS.ASM ASM equiv CLOSE_H
{
int handle;
char pathname[50];
...
handle = _create_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
... /* if successful */
close_h ();
jc main_010/* if an error occurred */
... /* if successful */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOCREA.ASM ASM equiv CREATE_H
{
int handle1, handle2;
char pathname[50];
...
handle1 = _open_h (pathname, FA_NORM);
if (handle1 == -1)
{
/* Handle the error */
} else
{
handle2 = _dup_h (handle1);
...
_close_h (handle1);
_close_h (handle2);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
dup_h (); /* AX=duplicated file handle */
jc main_010/* if an error occurred */
...
close_h ();
jc main_010/* if an error occurred */
mov bx,ax
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIODUP.ASM ASM equiv DUP_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
int extra_handle = _dup_h (STDOUT);
if (_dup2_h (handle, STDOUT))
{
/* Handle the error */
}
...
if (_dup2_h (extra_handle, STDOUT))
{
/* Handle the error */
}
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
mov dx,bx /* DX=file handle */
mov bx,STDOUT/* BX=file handle for STDOUT*/
dup_h (); /* AX=new handle for STDOUT*/
jc main_010/* if an error occurred */
mov cx,ax /* CX=new handle for STDOUT*/
mov ax,bx /* AX=file handle for STDOUT*/
mov bx,dx /* BX=file handle */
dup2_h (); /* redirect STDOUT to file */
jc main_010/* if an error occurred */
...
mov bx,cx /* BX=new handle for STDOUT*/
dup2_h (); /* redirect STDOUT to console */
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
mov bx,ax /* if an error occurred */
close_h ();
jncmain_020/* if an error occurred */
main_010:
... /* handle the error */
main_020:
...
}
Source file _FIODUP2.ASM ASM equiv DUP2_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
if (_eof_h (handle))
{
/* file pointer is at end of file */
} else
{
/* file pointer is not at end of file */
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_020/* if an error occurred */
eof_h ();
jb main_020/* if an error occurred */
ja main_010/* if not at end of file */
... /* file pointer at end of file */
main_010:
...
close_h ();
jc main_020/* if an error occurred */
...
jmp short main_030
main_020:
... /* Handle the error */
main_030:
...
}
Source file _FIOEOF.ASM ASM equiv EOF_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
/* Do some output to handle */
_flush_h (handle);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
flush_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOFLSH.ASM ASM equiv FLUSH_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int filesize = _getfsize_h (handle);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h ();
jc main_010/* if an error occurred */
...
getfsize_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOGFSZ.ASM ASM equiv GETFSIZE_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
int time,date;
if (_getftime_h (handle, &date, &time))
{
/* handle the error */
}
...
if (_setftime_h (handle, date, time))
{
/* Handle the error */
}
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
getftime_h (); /* DX;AX = date/time codes */
jc main_010/* if an error occurred */
...
setftime_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOGFTM.ASM ASM equiv GETFTIME_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
int chr = _hget_chr (handle);
if (chr < 0)
{
/* handle the error */
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc hget_chr_010/* if an error occurred */
... /* if successful */
write_h ();
jc hget_chr_010/* if an error occurred */
hget_chr (); /* AL=character read */
jnehget_chr_010/* if an error occurred */
...
close_h ();
jc hget_chr_010/* if an error occurred */
jmp short hget_chr_020
hget_chr_010:
... /* Handle the error */
hget_chr_020:
...
}
Source file _FIOGCHR.ASM ASM equiv HGET_CHR
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
char buffer[100];
if (_hget_line (handle, buffer, 100))
{
/* Handle the error */
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char buffer[100];
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h ();
jc hget_line_010/* if an error occurred */
lea si,buffer
mov cx,100
hget_line ();
jnehget_line_010/* if an error occurred */
close_h ();
jc hget_line_010/* if an error occurred */
jmp short hget_line_020
hget_line_010:
... /* Handle the error */
hget_line_020:
...
}
Source file _FIOGLIN.ASM ASM equiv HGET_LINE
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
char buffer[100];
if (_hget_str (handle, buffer, 100))
{
/* Handle the error */
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char buffer[100];
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc hget_str_010/* if an error occurred */
lea si,buffer
mov cx,100
hget_str ();
jnehget_str_010/* if an error occurred */
close_h ();
jc hget_str_010/* if an error occurred */
jmp short hget_str_020
hget_str_010:
... /* Handle the error */
hget_str_020:
...
}
Source file _FIOGSTR.ASM ASM equiv HGET_STR
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
if (_hput_chr (handle, 'a'))
{
/* Handle the error */
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc hput_chr_010/* if an error occurred */
...
mov al,'A'
hput_chr ();
jnehput_chr_010/* if error writing char */
close_h ();
jc hput_chr_010/* if an error occurred */
jmp short hput_chr_020
hput_chr_010:
... /* Handle the error */
hput_chr_020:
...
}
Source file _FIOPCHR.ASM ASM equiv HPUT_CHR
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
char string[50];
unsigned int num = _str_len (string);
...
if (_hput_str (handle, string) != num)
{
/* Handle the error */
}
_close_h (handle);
}
}
#include <inline.h>
{
char buffer[100];
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc hput_str_010/* if an error occurred */
lea si,buffer
hput_str ();
jnehput_str_010/* if an error occurred */
close_h ();
jnchput_str_020/* if no error occurred */
hput_str_010:
... /* Handle the error */
hput_str_020:
...
}
Source file _FIOPSTR.ASM ASM equiv HPUT_STR
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
if (_isatty_h (handle))
{
} else
{
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_020/* if an error occurred */
...
isatty_h ();
jc main_010/* if an error occurred */
ja main_010/* if file is not a chr device */
... /* file is a character device */
main_010:
...
close_h ();
jc main_010/* if an error occurred */
jmp short main_030
main_020:
... /* Handle the error */
main_030:
...
}
Source file _FIOISAT.ASM ASM equiv ISATTY_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int offset;
...
_lseekb_h (handle, offset);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
write_h ();
jc main_010/* if an error occurred */
mov ax,100
xor dx,dx
lseekb_h ();
jc main_010/* if an error occurred */
...
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOLSKB.ASM ASM equiv LSEEKB_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
_lseekbof_h (handle);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
lseekbof_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOLSBF.ASM ASM equiv LSEEKBOF_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int offset;
...
_lseekc_h (handle, offset);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
write_h ();
jc main_010/* if an error occurred */
mov ax,100
xor dx,dx
lseekc_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
...
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOLSKC.ASM ASM equiv LSEEKC_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int offset;
...
_lseeke_h (handle, offset);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
mov ax,100
xor dx,dx
lseeke_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOLSKE.ASM ASM equiv LSEEKE_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
_lseekeof_h (handle);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
lseekeof_h ();
jc main_010/* if an error occurred */
...
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOLSEF.ASM ASM equiv LSEEKEOF_H
{
int handle;
char pathname[50];
...
handle = _openex_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
openex_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
close_h ();
jncmain_020/* if no error occurred */
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOOPNE.ASM ASM equiv OPENEX_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
open_h (); /* BX=file handle */
jc open_010/* if an error occurred */
...
close_h ();
jncopen_010/* if no error occurred */
open_010:
... /* Handle the error */
open_020:
...
}
Source file _FIOOPEN.ASM ASM equiv OPEN_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
char buffer[50];
int num;
if (_read_h (handle, buffer, num))
{
/* Handle the error */
} else
{
...
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char buffer[100];
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
lea si,buffer
mov cx,100
read_h ();
jnemain_010/* if an error occurred */
close_h ();
jncmain_020/* if no error occurred */
main_010:
... /* display error message */
main_020:
...
}
Source file _FIOREAD.ASM ASM equiv READ_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int filesize;
...
_setfsize_h (handle, filesize);
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h ();
jc main_010/* if an error occurred */
...
mov ax,100
xor dx,dx
setfsize_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOSFSZ.ASM ASM equiv SETFSIZE_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
int time,date;
if (_getftime_h (handle, &date, &time))
{
/* handle the error */
}
...
if (_setftime_h (handle, date, time))
{
/* Handle the error */
}
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
getftime_h (); /* DX:AX = date/time codes */
jc main_010/* if an error occurred */
...
setftime_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOSFTM.ASM ASM equiv SETFTIME_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
long int filepos = _tell_h (handle);
...
_close_h (handle);
}
}
#include <inline.h>
{
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
...
tell_h ();
jc main_010/* if an error occurred */
...
close_h ();
jncmain_020/* if an error occurred */
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOTELL.ASM ASM equiv TELL_H
{
int handle;
char pathname[50];
...
handle = _open_h (pathname, FA_NORM);
if (handle == -1)
{
/* Handle the error */
} else
{
char buffer[100];
unsigned int num;
...
if (_write_h (handle, buffer, num) != num)
{
/* Handle the error */
} else
{
...
}
...
_close_h (handle);
}
}
#include <inline.h>
{
char buffer[100];
char pathname[50] = "file.dat";
...
lea si,pathname
mov ax,FA_NORM/* AX=file attributes */
create_h (); /* BX=file handle */
jc main_010/* if an error occurred */
lea si,buffer
mov cx,100
write_h ();
jc main_010/* if an error occurred */
close_h ();
jc main_010/* if an error occurred */
jmp short main_020
main_010:
... /* Handle the error */
main_020:
...
}
Source file _FIOWRIT.ASM ASM equiv WRITE_H