home *** CD-ROM | disk | FTP | other *** search
- 'Example/Test program for SLDECODE.ASM v1.0
- 'By Rich Geldreich 1992
- 'QB4.5 users: Use search and replace to change all "SSEG" strings to "VARSEG"
- 'strings in this program.
- 'Warning: The SLDecode ASM routine uses 80286 instructions!! I'll modify
- 'this soon, so please wait if you need an 8088/86 compatible routine.
- DEFINT A-Z
- DECLARE FUNCTION SLDecode (BYVAL SourceOffset%, BYVAL SourceSeg%, BYVAL DestOffset%, BYVAL DestSeg%)
-
- A$ = "OUTPUT.SL1" + CHR$(0)
- B$ = COMMAND$
-
- LOCATE , , 1
- PRINT "TSL.BAS v1.0 - Test Program for SLDECODE.ASM"
- PRINT "By Rich Geldreich 1992"
- B$ = COMMAND$
- IF B$ = "" THEN INPUT "File to decompress"; B$: B$ = UCASE$(B$)
- IF B$ = "" THEN END
- IF INSTR(B$, "OUTPUT.SL1") <> 0 THEN
- PRINT "Cannot decompress to source file."
- END
- END IF
- PRINT "Decompressing: "; B$;
- B$ = B$ + CHR$(0)
- E = SLDecode(SADD(A$), SSEG(A$), SADD(B$), SSEG(B$))
- LOCATE , 1: PRINT SPC(70); : LOCATE , 1
- SELECT CASE E
- CASE 0
- PRINT "Done."
- CASE -1
- PRINT "File I/O error."
- CASE -2
- PRINT "Decompression error."
- CASE ELSE
- PRINT "Unknown error!??"
- END SELECT
- END
-
-