home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Fest 1993
/
gamefest1993stgcomputerslimited1993.iso
/
soft
/
more3
/
pro3
/
1pass.doc
next >
Wrap
Text File
|
1990-09-19
|
10KB
|
261 lines
Substitute for DISKCOPY with more:
1.) Copies with one pass
2.) Allows multiple copies with one reading
3.) Detects destination and formats if necessary
4.) Uses Expanded memory when available
5.) Uses Hard Disk C:\ for temporary storage if necessary
6.) Checks its own CRC for integrity
I used Microsoft C version 6 as a code generator for 1PASS.EXE printf
and loops. The rest is all MASM 5.1.
If anyone wants the ASM and/or C source, drop me a note at CompuServe
(70206,1177). I will also welcome all comments.
These are the ASM functions called from MSC 6.0 to MASM5.1.
==================================================================
extern gotoXY( short, short);
/* locates cursor ( row, col ) */
==================================================================
extern writeXY( short, short, short, short);
/* locates and writes ( row, col, char to write, attribute) */
==================================================================
extern format( unsigned, unsigned, unsigned);
/* formats ( disk number 0=A etc.,size 360 720 1200 1440, verify 1 yes 0 no */
char _far *( _far *DDPT) = ((void _far *) 0x78); 0000:0078
DPPT = Diskette Drive Parameter Table. If BIOS does not recognize it,
format will fail. I have only tried it on my NEC 386SX
_setmedia uses ISR 13h functions 17h and 18h called with
AH=17h
AL=2 for 360k in 1200K drive
AL=3 for 1200k in 1200k drive
AL=4 for 720k in 720k drive
720k in 1140k drive
1140k in 1440k drive
AH=18h
CH= number of tracks
CL= sectors per track
DL= drive number
_formats uses ISR 13h function 5
AL= number of sectors to format
CH= cylinder number
DH= head number
DL= drive number
ES:BX pointer to address field for sectors
format() does not verify when called from 1PASS.EXE. The program uses
DOS absolute write after format() is called. These are the only that might
have compatibility problems.
==================================================================
extern chkems( char *);
/* chkems( pointer to "EMMXXX0" ) return 0 if EMS driver present */
==================================================================
extern emstat( int *, int *, int *);
/* returns( EMS page frame, total pages, available pages ) */
==================================================================
extern emsalloc( int *, int *);
/* returns( ems handle, pages allocated) */
==================================================================
extern emsdealloc( int *);
/* deallocates( ems handle ) */
==================================================================
extern emsmap( int *, int *, int *);
/* maps ( handle, logical page to, physical page) */
==================================================================
extern absread( void _far *, unsigned, unsigned, unsigned);
/* reads ( into far buffer, starting sector, drive #, number of sectors) */
==================================================================
extern abswrite( void _far *, unsigned, unsigned, unsigned);
/* writes( from far buffer, starting sector, drive #, number of sectors) */
==================================================================
extern tcreate(char _far *);
/* creates file( far pointer to name) returns handle if Ok else 0 */
==================================================================
extern topen(char _far *);
/* opens file( far pointer to name) returns handle if Ok else 0 */
==================================================================
extern twrite(char _far *, unsigned, unsigned);
/* writes to file( from far pointer buffer, handle, times) return 0 bad write*/
==================================================================
extern tread(char _far *, unsigned, unsigned);
/* reads from file ( to far pointer buffer, handle, times) return 0 bad read */
==================================================================
extern tclose( unsigned );
/* close ( handle ) */
==================================================================
extern tdelete( char _far *);
/* erases ( file pointed to by far name ) */
==================================================================
extern fcrc16( void _far *, unsigned, unsigned *);
/* ( far ptr to data, length in bytes, pointer to 0 return 16 bit CRC) */
==================================================================
extern crc16( char *, unsigned, unsigned *);
/* ( near ptr to data, length in bytes, pointer to 0 return 16 bit CRC) */
==================================================================
extern fcrcitt( void _far *, unsigned, unsigned *);
/* ( far ptr to data, length in bytes, pointer to 0 return 16 bit CRC) */
/* CCITT */
==================================================================
extern crcitt( char *, unsigned, unsigned *);
/* ( near ptr to data, length in bytes, pointer to 0 return 16 bit CRC) */
/* CCITT */
==================================================================
extern cls( void );
/* clear screen by scrolling up one page */
==================================================================
extern cursor( unsigned , unsigned *);
/* turn cursor( on=1/off=0, pointer to save cursor before turning off) */
==================================================================
extern checkc( void _far *);
checkc ( far pointer to a UNION REGS type:( same as in C but in MASM 5.1)
if(reg.x.ax = 0xFFFF) drive C: does not exist
==================================================================
_absread..........ABSREAD _abswrite.........ABSWRITE
_checkc...........CHECKC _chkems...........CHKEMS
_cls..............CLS _crc16............CRC16
_crc32............CRC32 _crc32m...........CRC32M
_crcitt...........CRCITT _cursor...........CURSOR
_DDPT.............FMS _emsalloc.........EMSALLOC
_emsdealloc.......EMSDEALL _emsmap...........EMSMAP
_emstat...........EMSTAT _fcrc16...........CRC16
_fcrc32...........FCRC32 _fcrc32m..........FCRC32M
_fcrcitt..........CRCITT _find_f...........FIND_F
_format...........FMS _formats..........FMS
_format_t.........FORMAT_T _gotoXY...........GOTOXY
_head0............FMS _head1............FMS
_make_table.......FCRC32M _pass.............FMS
_reset_t..........VERIFY_T _setmedia.........SETMEDIA
_tclose...........TCLOSE _tcreate..........TCREATE
_tdelete..........TDELETE _topen............TOPEN
_tracks...........FMS _tread............TREAD
_tseek............TSEEK _twrite...........TWRITE
_verify...........FMS _verify_t.........VERIFY_T
_writeXY..........WRITEXY
ABSREAD Offset: 00000010H Code and data size: 24H
_absread
ABSWRITE Offset: 00000120H Code and data size: 24H
_abswrite
CHECKC Offset: 00000230H Code and data size: 3cH
_checkc
CHKEMS Offset: 00000350H Code and data size: 1aH
_chkems
CLS Offset: 00000450H Code and data size: 28H
_cls
CRC16 Offset: 00000550H Code and data size: 2b1H
_crc16 _fcrc16
CRC32 Offset: 00000900H Code and data size: 47fH
_crc32
CRC32M Offset: 00000e80H Code and data size: 7dH
_crc32m
CRCITT Offset: 00000fe0H Code and data size: 2b1H
_crcitt _fcrcitt
CURSOR Offset: 00001390H Code and data size: 2bH
_cursor
EMSALLOC Offset: 000014a0H Code and data size: 1aH
_emsalloc
EMSDEALL Offset: 000015a0H Code and data size: 11H
_emsdealloc
EMSMAP Offset: 000016a0H Code and data size: 1aH
_emsmap
EMSTAT Offset: 000017a0H Code and data size: 20H
_emstat
FCRC32 Offset: 000018a0H Code and data size: 485H
_fcrc32
FCRC32M Offset: 00001e20H Code and data size: e1H
_fcrc32m _make_table
FIND_F Offset: 00002000H Code and data size: 31H
_find_f
FORMAT_T Offset: 00002110H Code and data size: 28H
_format_t
FMS Offset: 00002220H Code and data size: 20cH
_DDPT _format _formats _head0
_head1 _pass _tracks _verify
GOTOXY Offset: 000026b0H Code and data size: 1bH
_gotoXY
SETMEDIA Offset: 000027b0H Code and data size: 33H
_setmedia
TCLOSE Offset: 000028d0H Code and data size: 18H
_tclose
TCREATE Offset: 000029d0H Code and data size: 1cH
_tcreate
TDELETE Offset: 00002ad0H Code and data size: 18H
_tdelete
TOPEN Offset: 00002bd0H Code and data size: 19H
_topen
TREAD Offset: 00002cd0H Code and data size: 1eH
_tread
TSEEK Offset: 00002dd0H Code and data size: 25H
_tseek
TWRITE Offset: 00002ed0H Code and data size: 1eH
_twrite
VERIFY_T Offset: 00002fd0H Code and data size: 37H
_reset_t _verify_t
WRITEXY Offset: 00003100H Code and data size: 28H
_writeXY
@ res file to update subs.lib
+ABSREAD &
+ABSWRITE &
+CHECKC &
+CHKEMS &
+CLS &
+CRC16 &
+CRC32 &
+CRC32M &
+CRCITT &
+CURSOR &
+EMSALLOC &
+EMSDEALL &
+EMSMAP &
+EMSTAT &
+FCRC32 &
+FCRC32M &
+FIND_F &
+FORMAT_T &
+FMS &
+GOTOXY &
+MAKE_TAB &
+SETMEDIA &
+TCLOSE &
+TCREATE &
+TDELETE &
+TOPEN &
+TREAD &
+TSEEK &
+TWRITE &
+VERIFY_T &
+WRITEXY