v15i061: dmake version 3.6 (part 09/25)
Dennis Vadura
dvadura at watdragon.waterloo.edu
Mon Oct 15 11:39:27 AEST 1990
Posting-number: Volume 15, Issue 61
Submitted-by: Dennis Vadura <dvadura at watdragon.waterloo.edu>
Archive-name: dmake-3.6/part09
#!/bin/sh
# this is part 9 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file msdos/mscdos/mkswp.bat continued
#
CurArch=9
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
exit 1; fi
( read Scheck
if test "$Scheck" != $CurArch
then echo "Please unpack part $Scheck next!"
exit 1;
else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file msdos/mscdos/mkswp.bat"
sed 's/^X//' << 'SHAR_EOF' >> msdos/mscdos/mkswp.bat
Xmv getinp.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp quit.c
Xmv quit.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp basename.c
Xmv basename.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp dump.c
Xmv dump.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp macparse.c
Xmv macparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp rulparse.c
Xmv rulparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp percent.c
Xmv percent.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp function.c
Xmv function.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\ruletab.c
Xmv ruletab.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\dirbrk.c
Xmv dirbrk.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\runargv.c
Xmv runargv.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\arlib.c
Xmv arlib.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\_chdir.c
Xmv _chdir.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\switchar.c
Xmv switchar.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\rmprq.c
Xmv rmprq.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\find.c
Xmv find.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\spawn.c
Xmv spawn.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\mscdos\tempnam.c
Xmv tempnam.obj objects
Xlink @msdos\mscdos\objswp.rsp,dmake.exe,NUL.MAP;
SHAR_EOF
echo "File msdos/mscdos/mkswp.bat is complete"
chmod 0640 msdos/mscdos/mkswp.bat || echo "restore of msdos/mscdos/mkswp.bat fails"
echo "x - extracting msdos/mscdos/mk60swp.bat (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/mk60swp.bat &&
Xmkdir objects
Xmasm -t -mx -Dmcompact msdos\exec.asm;
Xmv exec.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ infer.c
Xmv infer.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ make.c
Xmv make.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ stat.c
Xmv stat.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ expand.c
Xmv expand.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ string.c
Xmv string.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ hash.c
Xmv hash.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dag.c
Xmv dag.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dmake.c
Xmv dmake.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ path.c
Xmv path.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ imacs.c
Xmv imacs.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ sysintf.c
Xmv sysintf.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ parse.c
Xmv parse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ getinp.c
Xmv getinp.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ quit.c
Xmv quit.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ basename.c
Xmv basename.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dump.c
Xmv dump.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ macparse.c
Xmv macparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ rulparse.c
Xmv rulparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ percent.c
Xmv percent.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ function.c
Xmv function.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\ruletab.c
Xmv ruletab.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\dirbrk.c
Xmv dirbrk.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\runargv.c
Xmv runargv.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\arlib.c
Xmv arlib.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\_chdir.c
Xmv _chdir.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\switchar.c
Xmv switchar.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\rmprq.c
Xmv rmprq.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\find.c
Xmv find.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\spawn.c
Xmv spawn.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\mscdos\tempnam.c
Xmv tempnam.obj objects
Xlink @msdos\mscdos\obj60swp.rsp,dmake.exe,NUL.MAP;
SHAR_EOF
chmod 0640 msdos/mscdos/mk60swp.bat || echo "restore of msdos/mscdos/mk60swp.bat fails"
echo "x - extracting msdos/mscdos/mk60.bat (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/mk60.bat &&
Xmkdir objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ infer.c
Xmv infer.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ make.c
Xmv make.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ stat.c
Xmv stat.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ expand.c
Xmv expand.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ string.c
Xmv string.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ hash.c
Xmv hash.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dag.c
Xmv dag.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dmake.c
Xmv dmake.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ path.c
Xmv path.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ imacs.c
Xmv imacs.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ sysintf.c
Xmv sysintf.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ parse.c
Xmv parse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ getinp.c
Xmv getinp.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ quit.c
Xmv quit.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ basename.c
Xmv basename.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ dump.c
Xmv dump.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ macparse.c
Xmv macparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ rulparse.c
Xmv rulparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ percent.c
Xmv percent.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ function.c
Xmv function.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\ruletab.c
Xmv ruletab.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\dirbrk.c
Xmv dirbrk.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\runargv.c
Xmv runargv.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\arlib.c
Xmv arlib.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\_chdir.c
Xmv _chdir.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\switchar.c
Xmv switchar.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\rmprq.c
Xmv rmprq.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Osecgle -Gs -D_MSC60_ msdos\mscdos\tempnam.c
Xmv tempnam.obj objects
Xlink @msdos\mscdos\obj60.rsp,dmake.exe,NUL.MAP;
SHAR_EOF
chmod 0640 msdos/mscdos/mk60.bat || echo "restore of msdos/mscdos/mk60.bat fails"
echo "x - extracting msdos/mscdos/mk.bat (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/mk.bat &&
Xmkdir objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp infer.c
Xmv infer.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp make.c
Xmv make.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp stat.c
Xmv stat.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp expand.c
Xmv expand.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp string.c
Xmv string.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp hash.c
Xmv hash.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp dag.c
Xmv dag.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp dmake.c
Xmv dmake.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp path.c
Xmv path.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp imacs.c
Xmv imacs.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp sysintf.c
Xmv sysintf.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp parse.c
Xmv parse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp getinp.c
Xmv getinp.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp quit.c
Xmv quit.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp basename.c
Xmv basename.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp dump.c
Xmv dump.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp macparse.c
Xmv macparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp rulparse.c
Xmv rulparse.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp percent.c
Xmv percent.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp function.c
Xmv function.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\ruletab.c
Xmv ruletab.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\dirbrk.c
Xmv dirbrk.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\runargv.c
Xmv runargv.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\arlib.c
Xmv arlib.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\_chdir.c
Xmv _chdir.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\switchar.c
Xmv switchar.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\rmprq.c
Xmv rmprq.obj objects
Xcl -c -DHELP -I. -Icommon -Imsdos -Imsdos\mscdos -D__STDC__=1 -DM_I86=1 -mc -Zp msdos\mscdos\tempnam.c
Xmv tempnam.obj objects
Xlink @msdos\mscdos\obj.rsp,dmake.exe,NUL.MAP;
SHAR_EOF
chmod 0640 msdos/mscdos/mk.bat || echo "restore of msdos/mscdos/mk.bat fails"
echo "x - extracting msdos/mscdos/libswp.rsp (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/libswp.rsp &&
X
SHAR_EOF
chmod 0640 msdos/mscdos/libswp.rsp || echo "restore of msdos/mscdos/libswp.rsp fails"
echo "x - extracting msdos/mscdos/lib60swp.rsp (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/lib60swp.rsp &&
X
SHAR_EOF
chmod 0640 msdos/mscdos/lib60swp.rsp || echo "restore of msdos/mscdos/lib60swp.rsp fails"
echo "x - extracting msdos/mscdos/lib60.rsp (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/lib60.rsp &&
X
SHAR_EOF
chmod 0640 msdos/mscdos/lib60.rsp || echo "restore of msdos/mscdos/lib60.rsp fails"
echo "x - extracting msdos/mscdos/lib.rsp (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/lib.rsp &&
X
SHAR_EOF
chmod 0640 msdos/mscdos/lib.rsp || echo "restore of msdos/mscdos/lib.rsp fails"
echo "x - extracting msdos/mscdos/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/config.mk &&
X# This is the MSC 4.0 and higher DOS configuration file for DMAKE
X# It simply modifies the values of SRC, and checks to see if
X# OSENVIRONMENT is defined. If so it includes the appropriate
X# config.mk file.
X#
X# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
X# directory.
X#
Xosrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
X
XTMPDIR :=
X.EXPORT : TMPDIR
X
X# Definition of macros for library, and C startup code.
X
X# The following sources are required for MSC
XOSR_SRC = tempnam.c
X.SETDIR=$(osrdir) : $(OSR_SRC)
X
XSRC += $(OSR_SRC)
X.SOURCE.h : $(osrdir)
X
X# Local configuration modifications for CFLAGS, there's local BSD includes
X# too.
X# If you have a 286, you can use -G2 or appropriate to get better code,
X# in that case uncomment the line below.
X#CFLAGS += -G2
XCFLAGS += -I$(osrdir) -D__STDC__=1 -DM_I86=1 $(C_$(MODEL))
XASFLAGS += -t -mx $(S_$(MODEL))
X
X# Redefine this, it isn't needed!
XLDTAIL = ;
X
X# Debugging Flags
XDB_CFLAGS += -Zi
XDB_LDFLAGS += /co /li /map
XDB_LDLIBS +=
X
X# NO Debug flags, MSC 6.0 flags, set the environment variable MSC_VER to be
X# 6.0 to get these by default when you make dmake using 'dmake'.
X.IMPORT .IGNORE : MSC_VER
X.IF $(MSC_VER) == 6.0
X NDB_CFLAGS += -Osecgle -Gs -D_MSC60_
X DB_CFLAGS += -D_MSC60_
X NDB_LDFLAGS += /exe /packc /batch
X NDB_LDLIBS +=
X.ELSE
X NDB_CFLAGS += -Zp
X DB_CFLAGS += -Zp
X.END
X
X# See if we modify anything in the lower levels.
X.IF $(OSENVIRONMENT) != $(NULL)
X .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
X.END
X
XC_s =
XC_m = -mm
XC_c = -mc
XC_l = -ml
X
XS_s = -Dmsmall
XS_m = -Dmmedium
XS_c = -Dmcompact
XS_l = -Dmlarge
SHAR_EOF
chmod 0640 msdos/mscdos/config.mk || echo "restore of msdos/mscdos/config.mk fails"
echo "x - extracting msdos/mscdos/config.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/config.h &&
X/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/mscdos/RCS/config.h,v 1.1 90/10/06 12:05:06 dvadura Exp $
X-- SYNOPSIS -- Configurarion include file.
X--
X-- DESCRIPTION
X-- There is one of these for each specific machine configuration.
X-- It can be used to further tweek the machine specific sources
X-- so that they compile.
X--
X-- AUTHOR
X-- Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
X--
X-- This program is free software; you can redistribute it and/or
X-- modify it under the terms of the GNU General Public License
X-- (version 1), as published by the Free Software Foundation, and
X-- found in the file 'LICENSE' included with this distribution.
X--
X-- This program is distributed in the hope that it will be useful,
X-- but WITHOUT ANY WARRANTY; without even the implied warrant of
X-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X-- GNU General Public License for more details.
X--
X-- You should have received a copy of the GNU General Public License
X-- along with this program; if not, write to the Free Software
X-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X-- $Log: config.h,v $
X * Revision 1.1 90/10/06 12:05:06 dvadura
X * dmake Release, Version 3.6
X *
X*/
X
X/* define this for configurations that don't have the coreleft function
X * so that the code compiles. To my knowledge coreleft exists only on
X * Turbo C, but it is needed here since the function is used in many debug
X * macros. */
X#define coreleft() 0L
X
X/*No parallelism in DOS so don't need to explode the graph. */
X#define Explode_prq(a,b,c)
X
X/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */
X#ifndef SIGTERM
X# define SIGTERM SIGINT
X#endif
X
X/* Fixes unimplemented line buffering for MSC
X * MSC _IOLBF is the same as _IOFBF
X * This redefinition causes the following warning, but ignore it
X * c:/usr/include/stdio.h(129) : warning C4005: '_IOLBF' : macro redefinition
X */
X#if defined(MSDOS) && defined (_MSC_VER)
X# undef _IOLBF
X# define _IOLBF _IONBF
X#endif
X
X/* in alloc.h: size_t is redefined
X * defined in stdio.h which is included alloc.h
X */
X#if defined(MSDOS) && defined (_MSC_VER)
X# define _TYPES_
X#endif
X
X/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */
X#ifndef SIGQUIT
X# define SIGQUIT SIGTERM
X#endif
SHAR_EOF
chmod 0440 msdos/mscdos/config.h || echo "restore of msdos/mscdos/config.h fails"
echo "x - extracting msdos/find.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/find.c &&
X/*
X Directory Access Library
X
X FIND.C taken from DIRLIB.C by M. J. Weinstein
X Released to public domain 1-Jan-89
X
X The author may be contacted at:
X matt at cs.ucla.edu -or- POB 84524, L.A., CA 90073
X
X Modified by dvadura at watdragon.edu to work with dmake.
X (nuked the DOS version 2 code, since dmake needs version
X 3.0 or greater to function).
X */
X
X
X/*
X * revision history:
X *
X * VER MM/DD/YY COMMENTS
X * ---- -------- --------
X * 0.99 02/24/86 Beta release to INTERNET
X */
X
X#include <stdlib.h>
X#include <ctype.h>
X#include <errno.h>
X#include <string.h>
X#include <alloc.h>
X#include <dos.h>
X#include "dirlib.h"
X
X#ifndef MK_FP
X#define MK_FP(seg,ofs) ((void far *) \
X (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
X#endif
X
Xint _err;
Xstatic DTA far *_getsetdta ANSI((DTA far *));
X
X/*
X * get/set dta address
X */
X
Xstatic DTA far *
X_getsetdta(newdta)
XDTA far *newdta;
X{
X DTA far *olddta;
X union REGS r;
X struct SREGS s;
X
X /* get old dta */
X r.h.ah = 0x2f;
X intdos(&r, &r);
X segread(&s);
X olddta = (DTA far *) MK_FP(s.es, r.x.bx);
X
X /* conditionally set new dta */
X if (newdta) {
X r.h.ah = 0x1a;
X s.ds = FP_SEG(newdta);
X r.x.dx = FP_OFF(newdta);
X intdosx(&r, &r, &s);
X }
X
X return olddta;
X}
X
X/*
X * dos findfirst
X */
X
XDTA *
Xfindfirst(name, dta)
Xchar *name;
XDTA *dta;
X{
X union REGS r;
X struct SREGS s;
X DTA far *dtasave;
X char far *nmp = (char far *)name;
X
X dtasave = _getsetdta((DTA far *)dta);
X
X /* do directory lookup */
X segread(&s);
X r.h.ah = 0x4e;
X r.x.cx = 0x10;
X r.x.dx = FP_OFF(nmp);
X s.ds = FP_SEG(nmp);
X intdosx(&r, &r, &s);
X /* restore dta */
X _getsetdta(dtasave);
X _err = r.x.ax;
X if (r.x.cflag)
X return (DTA *) 0;
X
X return dta;
X}
X
X/*
X * dos findnext
X */
X
XDTA *
Xfindnext(dta)
XDTA *dta;
X{
X union REGS r;
X DTA far *dtasave;
X
X dtasave = _getsetdta((DTA far *)dta);
X
X /* do directory lookup */
X r.h.ah = 0x4f;
X intdos(&r, &r);
X /* restore old dta */
X _getsetdta(dtasave);
X _err = r.x.ax;
X if (r.x.cflag)
X return (DTA *) 0;
X
X return dta;
X}
SHAR_EOF
chmod 0440 msdos/find.c || echo "restore of msdos/find.c fails"
echo "x - extracting msdos/exec.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/exec.h &&
X#ifndef _EXEC_h_
X#define _EXEC_h_
X
X#ifndef ANSI
X#if defined(__STDC__) || defined(__TURBOC__)
X#define ANSI(x) x
X#else
X#define ANSI(x) ()
X#endif
X#endif
X
Xextern int exec ANSI((int, char far *, char far *, unsigned int,
X unsigned int, char far *));
X
X#ifndef MK_FP
X#define MK_FP(seg,ofs) \
X ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
X#endif
X
X#endif
SHAR_EOF
chmod 0440 msdos/exec.h || echo "restore of msdos/exec.h fails"
echo "x - extracting msdos/exec.asm (Text)"
sed 's/^X//' << 'SHAR_EOF' > msdos/exec.asm &&
X; You must assemble this file with masm (or tasm) flag
X; /dmmodel where model is one of {small, compact, medium, large}
X;
Xifdef msmall
X .model small
Xargbase equ 4
Xendif
Xifdef mcompact
X .model compact
Xargbase equ 4
Xendif
Xifdef mmedium
X .model medium
Xargbase equ 6
Xendif
Xifdef mlarge
X .model large
Xargbase equ 6
Xendif
Xa_swap equ <bp+argbase+0>
Xa_prog equ <bp+argbase+2>
Xa_tail equ <bp+argbase+6>
Xa_env equ <bp+argbase+10>
Xa_esiz equ <bp+argbase+12>
Xa_tmp equ <bp+argbase+14>
X
X
X; Define all useful equ's
Xswap_xms equ 0 ; we swapped it out to xms
Xswap_ems equ 2 ; we swapped it out to ems
Xswap_file equ 4 ; we swapped it out to a file
Xseg_no_alloc equ 0 ; this is part of a segment
Xseg_alloc equ 1 ; this is a full segment header
Xseg_data equ 2 ; this is data for part of a segment
X
X
X; Define any global/external variables that we will be accessing from here.
X .data
X extrn _errno:word ; Set to dos ret code from exec
X public _Interrupted ; Set to 1 if interrupted 0
X_Interrupted dw 0 ; otherwise
X
X .code
X assume cs:@code, ds:@code, ss:@code, es:@code
X
Xexecstack dw 64 dup (?) ; put the temporary exec stack right
Xexec_sp label word ; at the start.
X
Xold_ss dw ? ; save stack seg across exec
Xold_sp dw ? ; save stack ptr across exec
Xprogsize dw ? ; original size of the program
Xresend dw ? ; paragraph where resident code ends
Xenvseg dw ? ; paragraph of environment segment
Xenvsize dw ? ; length of environment in paragraphs
Xpsp dw ? ; our own psp
Xswap dw ? ; swapping selection flag
Xretcode dw ? ; return code from exec
Xinterrupted dw ? ; interrupted flag for exec
Xarenahead dw ? ; start of memory block list
Xalstr dw ? ; allocation strategy save spot
Xin_exec dw 0 ; flag, 1 ==> in exec
X
Xcmdpath db 65 dup(?) ; file to exec
Xcmdtail db 129 dup(?) ; it's command tail
Xfcb db 37 dup(0) ; dummy fcb
Xtmpseg db 7 dup(?) ; block header buffer
X
Xtmpname db 65 dup(0) ; name of temporary file resource
Xtmphandle dw ? ; handle for temporary file
X
Xerror_rhdr db "exec: Failure reading header block", 0DH, 0AH, '$'
Xerror_rseg db "exec: Failure reading segment data", 0DH, 0AH, '$'
Xerror_resize db "exec: Failure on resize", 0DH, 0AH, '$'
Xerror_free db "exec: Failure to free a block", 0DH, 0AH, '$'
Xerror_string db "exec: Program swap failure", 0DH, 0AH, '$'
Xerror_alloc db "exec: Memory blocks don't match", 0DH, 0AH, '$'
X
Xwrite_header label word
X whdr_xms_ptr dw word ptr whdr_xms
X whdr_ems_ptr dw word ptr whdr_ems
X whdr_file_ptr dw word ptr whdr_file
X
Xwrite_seg label word
X wseg_xms_ptr dw word ptr wseg_xms
X wseg_ems_ptr dw word ptr wseg_ems
X wseg_file_ptr dw word ptr wseg_file
X
Xread_header label word
X rhdr_xms_ptr dw word ptr rhdr_xms
X rhdr_ems_ptr dw word ptr rhdr_ems
X rhdr_file_ptr dw word ptr rhdr_file
X
Xread_seg label word
X rseg_xms_ptr dw word ptr rseg_xms
X rseg_ems_ptr dw word ptr rseg_ems
X rseg_file_ptr dw word ptr rseg_file
X
Xfree_resource label word
X free_xms_ptr dw word ptr free_xms_resource
X free_ems_ptr dw word ptr free_ems_resource
X free_file_ptr dw word ptr free_file_resource
X
Xreset_resource label word
X reset_xms_ptr dw word ptr reset_xms_resource
X reset_ems_ptr dw word ptr reset_ems_resource
X reset_file_ptr dw word ptr reset_file_resource
X
Xold_ctl_brk label dword
X old_ctl_brk_off dw ?
X old_ctl_brk_seg dw ?
X
Xold_crit_err label dword
X old_crit_err_off dw ?
X old_crit_err_seg dw ?
X
Xexec_block label word
X ex_envseg dw ? ; env seg, use parent's if 0
X ex_cmdtail dd ? ; command tail for exec
X ex_fcb1 dd far ptr fcb ; fcb's aren't used by dmake
X ex_fcb2 dd far ptr fcb
X ex_ss dw ? ; saved ss for exec
X ex_sp dw ? ; saved sp for exec
X ex_error dw 0 ; error code for dos exec
X
X;-----------------------------------------------------------------------------
X; First define the critical-error and control-brk handlers.
X; The critical error handler simply pops the machine state and returns an
X; access denied result code.
Xcrit_err_handler proc near
X add sp, 6 ; ip/cs/flags ...
X pop ax
X pop bx
X pop cx
X pop dx
X pop si
X pop di
X pop bp
X pop ds
X pop es
X push bp ; fix up the return flags
X mov bp, sp
X xchg ax, [bp+6] ; get the flag byte.
X or ax, 1 ; set the carry bit
X xchg ax, [bp+6] ; put it back.
X pop bp
X mov ax, 5 ; access denied
X iret
Xcrit_err_handler endp
X
X
X;-----------------------------------------------------------------------------
X; Here we set the interrupted flag, and terminate the currently running
X; ess. proc
Xctl_brk_handler proc near
X inc cs:interrupted ; set the flag
X
X; Make certain it isn't us that is going to get terminated.
X; There is a small window where the in_exec flag is set but the child is
X; not running yet, I assume that DOS doesn't test for ctl_brk at that time
X; as it is bussily creating a new ess. proc
X cmp cs:in_exec,0
X je just_return
X mov ax, 04cffH ; stop the sucker!
X int 21H
Xjust_return: ret
Xctl_brk_handler endp
X
X
X;-----------------------------------------------------------------------------
X; Something really nasty happened, so abort the exec call and exit.
X; This kills the calling ess proc altogether, and is a very nasty way of
X; termination since files may still be open etc.
Xabort_exec_rhdr label near
X mov dx, offset error_rhdr
X jmp print_it
Xabort_exec_rseg label near
X mov dx, offset error_rseg
X jmp print_it
Xabort_exec_resize label near
X mov dx, offset error_resize
X jmp print_it
Xabort_exec_free label near
X mov dx, offset error_free
X jmp print_it
Xabort_exec_alloc label near
X mov dx, offset error_alloc
X jmp print_it
Xabort_exec proc near
X mov dx, offset error_string
Xprint_it: mov bx, [swap]
X call [free_resource+bx]
X mov ax, cs
X mov ds, ax
X mov ah, 9
X int 21H
Xkill_program: mov ax, 04cffH ; nuke it!
X int 21H
Xabort_exec endp
X
X
X;-----------------------------------------------------------------------------
X; lodsw/stosw loop to copy data. Called only for word copy operations.
X; ds:si - point at source
X; es:di - point at destination
X; cx - count of bytes to copy.
Xcopy_data proc near
X shr cx, 1 ; convert to word count
X jnc copy_words
X movsb
Xcopy_words: rep movsw ; copy the words.
X ret
Xcopy_data endp
X
X
X
X;=============================================================================
X; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ XMS RECORDS.
X;=============================================================================
Xrhdr_xms proc near
X ret
Xrhdr_xms endp
X
Xrseg_xms proc near
X ret
Xrseg_xms endp
X
Xreset_xms_resource proc near
X ret
Xreset_xms_resource endp
X
Xfree_xms_resource proc near
X ret
Xfree_xms_resource endp
X;=============================================================================
X
X
X
X;=============================================================================
X; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ EMS RECORDS.
X;=============================================================================
Xrhdr_ems proc near
X ret
Xrhdr_ems endp
X
Xrseg_ems proc near
X ret
Xrseg_ems endp
X
Xreset_ems_resource proc near
X ret
Xreset_ems_resource endp
X
Xfree_ems_resource proc near
X ret
Xfree_ems_resource endp
X;=============================================================================
X
X
X
X;=============================================================================
X; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ FILE RECORDS.
X;=============================================================================
X; This routine reads a segment header from a file.
X; The header is a seven byte record formatted as follows:
X; segment address - of data
X; offset address - of data
X; length in paragraphs - of data
X; mode - 1 => segment header (allocate seg on read)
X; 0 => subsegment, don't allocate on read.
X; The information is placed into the tmpseg data area in the code segment.
X; The routine aborts if an error is detected.
Xrhdr_file proc near
X mov dx, offset tmpseg ; read the header record out
X mov cx, 7
X mov bx, [tmphandle]
X mov ah, 03fH
X int 21H
X jnc rhdr_done ; make sure it worked
X jmp abort_exec_rhdr
X
Xrhdr_done: cmp ax, 7
X je exit_rhdr_file
X or ax, ax
X je signal_eof
X jmp abort_exec_rhdr
X
Xsignal_eof: stc
Xexit_rhdr_file: ret
Xrhdr_file endp
X
X
X;-----------------------------------------------------------------------------
X; Read a segment from the temporary file whose handle is in cs:tmphandle.
X; The routine aborts if an error is detected.
Xrseg_file proc near
X push ds
X mov ds, word ptr cs:tmpseg; Now read the whole segment
X mov dx, word ptr cs:tmpseg+2
X mov cx, word ptr cs:tmpseg+4
X mov bx, cs:tmphandle
X mov ah, 03fH
X int 21H
X pop ds
X jnc rseg_done
X jmp abort_exec_rseg
X
Xrseg_done: cmp ax, [word ptr tmpseg+4]
X je exit_rseg_file
X jmp abort_exec_rseg ; If we didn't get read full
Xexit_rseg_file: ret ; segment then abort
Xrseg_file endp
X
X
X;-----------------------------------------------------------------------------
X; Seek to the beginning of the file.
Xreset_file_resource proc near
X mov bx, [tmphandle]
X xor cx, cx
X mov dx, cx
X mov ax, 04200H ; seek to begining of file
X int 21H
X ret
Xreset_file_resource endp
X
X
X;-----------------------------------------------------------------------------
X; unlink the temporary file allocated for swapping.
X; We close the file first, and then delete it. We ignore errors here since
X; we can't do anything about them anyway.
Xfree_file_resource proc near
X mov bx, [tmphandle] ; get the file handle
X mov ah, 03eH ; close the file
X int 21H
X mov dx, offset tmpname ; Now delete the temp file
X mov ah, 041H
X int 21H
X ret
Xfree_file_resource endp
X;=============================================================================
X
X
X
X;=============================================================================
X; CODE TO SWAP THE IMMAGE IN FROM SECONDARY STORAGE
X;=============================================================================
Xswap_in proc near
X mov bx, [alstr] ; get previous alloc strategy
X mov ax, 5801H ; and set it back
X int 21H
X mov bx, [swap] ; get type of resource
X call [reset_resource+bx] ; reset the resource
X mov es, [psp] ; resize the program back
X mov bx, [progsize] ; to original size
X mov ah, 04AH
X int 21H
X jnc read_seg_loop
X jmp abort_exec
X
Xread_seg_loop: mov bx, [swap] ; get type of resource
X call [read_header+bx] ; get seg header
X jc exit_swap_in ; all done
X mov al, [tmpseg+6]
X cmp al, seg_no_alloc ; see if dummy segment header
X je read_seg_loop
X cmp al, seg_alloc ; do we need to do an alloc?
X jne read_data ; nope
X
X; Allocate back the memory for a segment that is not the [psp], note that this
X; must come back to the same segment we had previously since other segments
X; may have pointers stored in their variables that point to this segment using
X; segment:offset long pointers.
X mov bx, [word ptr tmpseg+4] ; get count of paragraphs
X mov ah, 048H ; dos_alloc
X int 21H
X jc alloc_error ; oops!
X cmp ax, [word ptr tmpseg] ; did we get the same segment?
X je read_seg_loop ; yup!
Xalloc_error: jmp abort_exec_alloc
X
Xread_data: mov bx, [swap]
X call [read_seg+bx] ; this must succeed, if fail
X jmp read_seg_loop ; we never come back here
X
Xexit_swap_in: mov bx, [swap] ; all done, so free resource
X call [free_resource+bx]
X ret
Xswap_in endp
X
X
X;=============================================================================
X; CODE TO SWAP THE IMMAGE OUT TO SECONDARY STORAGE
X;=============================================================================
X; This routine is called to swap the non-resident portion of the program
X; out to the resource specified by the value of [cs:swap]. If the swap out
X; fails, then appropriate routines are called to free the resources allocated
X; up to that point.
X;
X; The steps used to swap the program out are as follows:
X; - calculate new size of program to remain resident and size to swap
X; out.
X; - write out non-resident portion of current segment
X; - walk DOS allocation chain and write out all other segments owned by
X; the current program that are contiguous with the _psp segment
X; - copy the environment down to low memory
X; - resize the current _psp segment to savesize+envsize.
X; - free all segments belonging to program except current _psp segment
Xswap_out proc near
X mov ax, 05800H ; get memory alocation strategy
X int 021H
X mov [alstr], ax ; and save it for future restoration.
X mov di, [psp] ; compute length of program to current
X mov bx, cs ; value of cs, and find program size
X sub bx, di ; by looking at length stored in
X mov ax, di ; arena header found in front of psp
X dec ax
X mov es, ax
X mov si, es:3 ; si is size of program in paragraphs
X mov [progsize], si ; progsize now contains the size.
X
X; Now compute length of program segment to save.
X; Length is: cs - psp + (offset overlay_code_here+15 >> 4)
X mov ax, offset overlay_code_here+15
X shr ax, 1
X shr ax, 1
X shr ax, 1
X shr ax, 1
X add bx, ax ; bx is size of program to keep
X sub si, bx ; si is # of paragraphs to save.
X add di, bx ; di is paragraph to start at
X mov resend, di ; cs:resend is saved start para
X mov al, seg_no_alloc ; set no allocation for segment
X call write_segment
X jc abort_swap_out
X
X; We have now saved the portion of the program segment that will not remain
X; resident during the exec. We should now walk the DOS allocation chain and
X; write out all other segments owned by the current ess. proc
X mov ax, [psp]
X dec ax
X mov es, ax
X mov bx, offset write_segment_data
X call walk_arena_chain
X jc abort_swap_out
X
X; Now we must walk the chain of allocated memory blocks again and free
X; all those that are owned by the current ess, proc except the one that is
X; the current ess' proc psp.
Xfree_segments: mov es, [psp]
X mov bx, offset free_dos_segment
X call walk_arena_chain
X jnc copy_environ
X jmp abort_exec_free ; can't fix it up now.
X
X; we have now written all segments that belong to the program to some
X; other resource. We can now copy the environment and resize the psp
X; segment.
Xcopy_environ: mov ax, [envseg] ; get the environment segment
X or ax, ax ; skip copy if it's null
X je resize_program
X push ds
X push es
X mov bx, [resend] ; here is where the environ goes
X mov es, bx
X mov cx, [envsize]
X add bx, cx
X sub bx, [psp]
X mov [envsize], bx ; bx is size of program after
X shl cx, 1 ; environ is copied.
X shl cx, 1
X shl cx, 1
X shl cx, 1
X mov ds, ax ; ds:si is source address
X xor si, si ; es:di is dest address
X mov di, si ; cx is count in bytes.
X call copy_data
X mov [envseg], es ; point the envseg at the
X pop es ; right spot
X pop ds
X
X; We now resize the program to the size specified by cs:envsize. This will
X; free the memory taken up by the current program segment.
Xresize_program: mov es, [psp] ; es is segment to resize.
X mov bx, [envsize] ; bx is size of segment.
X mov ah, 04aH ; resize memory block
X int 21H
X jnc swap_out_ok
X jmp abort_exec_resize ; disaster
Xswap_out_ok: ret
X
X; The swap out failed for some reason, so free any allocated resources
X; and set the carry bit.
Xabort_swap_out: mov bx, [swap]
X call [free_resource+bx]
X xor ax, ax
X mov [swap], ax ; clear the swap flag
X stc
X ret
Xswap_out endp
X
X
X;=============================================================================
X; CODE TO SET-UP FOR AND EXEC THE CHILD PROCESS
X;=============================================================================
X; Actually execute the program. If cs:swap is set, this code will invoke the
X; swap-out/swap-in code as required.
Xdo_exec proc near
X cmp [swap], 0 ; does the user want to swap?
X je no_swap_out ; nope
X call init_swap ; figger out where to swap to
X jc no_swap_out ; if carry set then don't swap
X call swap_out
X
Xno_swap_out: cmp [interrupted], 0 ; were we interrupted?
X jne leave_exec ; yep, so clean up, don't exec
X
X; set up the parameter block for the DOS exec call.
X; offset contents
X; 00 segment address of environment to be passed,
X; 0 => use parents env.
X; 02 pointer to command tail for new ess. proc
X; 06 pointer to fcb1
SHAR_EOF
echo "End of part 9"
echo "File msdos/exec.asm is continued in part 10"
echo "10" > s2_seq_.tmp
exit 0
More information about the Comp.sources.misc
mailing list