home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
TURBO-06.ZIP
/
FILEIO.INC
< prev
next >
Wrap
Text File
|
1985-02-23
|
1KB
|
67 lines
procedure set_dta;
begin
{-- Set DTA address --}
pointer := addr(dta_area);
r.ds := seg(pointer^);
r.dx := ofs(pointer^);
r.ax := $1A shl 8;
MsDos(R);
end;
procedure get_dta;
begin
{-- Get DTA address in ES:BX --}
r.ax := 0;
r.es := 0;
r.bx := 0;
r.ax := $2F shl 8;
MsDos(R);
dta := ptr(r.es,r.bx);
end;
procedure set_fcb;
begin
{-- Set up an unopened FCB --}
for x := -7 to 36 do fcb[x] := #0;
fcb[-7] := #255;
fcb[-1] := #0;
filez := '*.*' + #0;
pointer := addr(filez[1]);
r.ds := seg(pointer^);
r.si := ofs(pointer^);
pointer := addr(fcb[0]);
r.es := seg(pointer^);
r.di := ofs(pointer^);
r.ax := $29 shl 8;
msdos(R);
set_dta;
get_dta;
end;
procedure msdos12;
begin
set_dta;
pointer := addr(fcb[-7]);
r.ds := seg(pointer^);
r.dx := ofs(pointer^);
r.ax := $12 shl 8; { go after the next matching entry }
msdos(R);
end;
procedure msdos11(x : integer);
begin
set_fcb;
fcb[-7] := #255;
fcb[-1] := chr(x);
pointer := addr(fcb[-7]);
r.ds := seg(pointer^);
r.dx := ofs(pointer^);
r.ax := $11 shl 8;
msdos(R);
end;
dta_area : array [1..130] of byte;
fcb : array [-7..36] of char;
type mem_ptr = ^pointer_type;
pointer_type = array [1..2] of integer;
var pointer,dta,fcb_addr : mem_ptr;