home *** CD-ROM | disk | FTP | other *** search
- January 25, 1986
-
- STRNFST2
-
-
- STRNFST2.PAS is a collection of inline string manipulation
- routines for Turbo Pascal Version 3. Many of them are found in
- the earlier STRNGFAST.PQS, but one of those has been slightly
- modified here, and there are eight new ones.
-
- Two other files are included here. One, COMSTRIP.PAS is a
- Turbo program designed to make Inline routines produced by Dave
- Baldwin's Inline.Com program a bit easier to use. Inline.Com
- turns the original assembly language into Turbo comments in the
- Inline code. COMSTRIP gets rid of all single line comments
- between the start and the end of Inline.Com output. It also
- puts more of the Inline code on each line. Thus COMSTRIP can
- turn this:
-
- Function Count (var tst; srch:char):integer;
- begin
- Inline(
- {;Function Count(var tst; srch:char):integer}
- {;Returns count of instances of srch in string tst}
- $1E { PUSH ds}
- /$C4/$BE/>TST { LES DI,>TST[BP] ; ES:DI to start}
- /$8C/$C0 { mov ax,es}
- /$8E/$D8 { mov ds,ax}
- /$8A/$86/>SRCH { MOV AL,>SRCH[BP] ; search char}
- /$29/$DB { sub bx,bx ;zero in bx -- for counting}
- /$29/$C9 { SUB CX,CX ; zero in CX}
- /$8A/$0D { MOV CL,[DI] ; length in CX}
- /$E3/$0B { JCXZ QUIT ; exit if null}
- /$47 { INC DI ; first char}
- /$FC { CLD ; frontwards}
- /$E3/$07 {MORE: JCXZ QUIT ; no more}
- /$F2/$AE {REPNE SCASB ; do search}
- /$75/$03 { JNE QUIT ; not found}
- /$43 { inc bx ;count it}
- /$EB/$F7 { JMP MORE ; try for more}
- /$89/$5E/$0A {QUIT: mov [bp+10],bx ;get function result}
- /$1F { pop ds}
- );
- end;
-
-
- into this:
-
- Function Count (var tst; srch:char):integer;
- begin
- Inline(
- $1E/$C4/$BE/>TST/$8C/$C0/$8E/$D8/$8A/$86/>SRCH/$29/$DB/$29/$C9/$8A/$0D/$E3/
- $0B/$47/$FC/$E3/$07/$F2/$AE/$75/$03/$43/$EB/$F7/$89/$5E/$0A/$1F);
- end;
-
- If you use COMSTRIP on STRNFST2.PAS and then get rid of the
- remaining comment lines with an editor, you produce a file of
- maybe 7-8K, which is a lot quicker to load into Turbo as an
- include file.
-
- RESTORE.PAS also takes output from Inline.Com. It strips
- out everything added by Inline.Com. You therefore wind up with
- the original assembly language file used as input to Inline.Com.