PAGE 56,80
@FILENAME       EQU <ASWIT.COM>
COMMENT |
*****************************************************************************
Date:           21/01/98 - 15/02/98.
File Name:      ASWIT-01.ASM.
Description:    ACESOFT SUBLIMATE WRITING INTO TEXT.
Version:        1.00 FIRST VERSION.
Purpose:        A command line text file ASC2 normaliser.
OutputFormat:   Initially as a .COM file.
            Watch this space for a WINDOWS version.
Comments:       Decided to develop this to automate HTML text extraction.

            It's a funny old world - but on playing with the Internet
            some more..................

Objectives:
            Open file for input if extant else quit.
            Open file for output if not *.asw format else quit.
            Check if input file *.html, or *.hst set flag if it is.
            Get bytes using a subroutine with a eof dropout to close all.

HTML:
     Look for " on same line:
              does it contain HTTP/http \ or / (it must have no spaces):
          if so write line with " delineators till repeat of " or '<CR>'.
          *N.B. Can't use ' type delineator!!!!!!!!!

HST/WBS:
    Look for HTTP/http and x:\........
         write line with " delineators till character equal or below 0Dh.
       lines are assumed to terminate on 0 (NUL) or >=80h characters.

Any Other:

    File must be pre-read to find out whether strings of 0Ah exist in odd or
even numbers etc.:
             Lone 0Dhs must each be converted to 0D0Ah characters.
             Lone 0Ahs must each be converted to 0D0Ah characters.
             Paired 0Ahs (0A0Ahs) must be converted to 0D0Ah characters.
             0D0Ah characters must be ignored.
                   Lone 0Dhs = NULType 1 (bit 0).
                   Lone 0Ahs = NULType 2 (bit 1).
                   Paired 0Ahs (0A0Ahs) = NULType 128 (bit 7)
                   0D0Ah = NULType 0 (NUL).
All four represent distinct types of ASC2 text file and have to be treated
accordingly.

    Replace single #0s or #0 strings with a single rtn.
    Replace 0Ah type returns with full 0Dh,0Ah ones.
    Else copy character.


ShareWare Version:
          The ShareWare Versionof ASWIT will have a file length restriction
built into it to encourage registration.

*****************************************************************************

Error Returns:

0). Use: ASWIT [PATH]FILENAME.TYPE<Return>.
1). Name/path too long i.e. <= 63+8+4==75-4 (for an extra file type if needed).
2). Bad file name given.
3). Illegal file type.
4). Sorry I won't operate on an ASW file, they're my children.
5). Error opening input file.
6). Error opening output file.
7). Error reading input file.
8). Error writing output file.
9). Error closing input file.
10). Error closing output file.
11). Job done, no errors.
12). Bad program environment.
13). Must use DOS 3 or higher.

*****************************************************************************
|
            MASM
            .MODEL TINY, NOLANGUAGE ;;ASSEMBLER WINDOWS
            .8086
;;              .386
            .SEQ
;;                .STACK 100h
            %CREF

;;                .DATA
            .CONST
TRUE            = 1
FALSE           = 0
NUL             = 0
DTest           = 0     ;;1=Test of unscrambled ASWIT.COM file.
ATest           = 0     ;;1=Test of NUL File type.
ShareWare       = 1     ;;1=ShareWare, 0=Registered.
SWLimit         = 25    ;;i.e. 24*255 bytes = 6k, plus one
HTML            = 1     ;;HTML input file type.
HST             = 2     ;;HST input file type.
ASW             = 4     ;;ASW input file type.

StartAswit      PROC NOWINDOWS ;;WINDOWS
            .CODE
            ORG 100h
AswitCode:      ;;************************************************************
