home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / STRNFST2.ZIP / READ.ME < prev    next >
Encoding:
Text File  |  1987-01-25  |  2.7 KB  |  63 lines

  1.                                         January 25, 1986
  2.  
  3.                             STRNFST2
  4.  
  5.  
  6.      STRNFST2.PAS is a collection of inline string manipulation
  7. routines for Turbo Pascal Version 3.  Many of them are found in
  8. the earlier STRNGFAST.PQS, but one of those has been slightly
  9. modified here, and there are eight new ones.
  10.  
  11.      Two other files are included here.  One, COMSTRIP.PAS is a
  12. Turbo program designed to make Inline routines produced by Dave
  13. Baldwin's Inline.Com program a bit easier to use.  Inline.Com
  14. turns the original assembly language into Turbo comments in the
  15. Inline code.  COMSTRIP gets rid of all single line comments
  16. between the start and the end of Inline.Com output.  It also
  17. puts more of the Inline code on each line.  Thus COMSTRIP can
  18. turn this:
  19.  
  20. Function Count (var tst; srch:char):integer;
  21. begin
  22. Inline(
  23.                     {;Function Count(var tst; srch:char):integer}
  24.                     {;Returns count of instances of srch in string tst}
  25.   $1E               {          PUSH      ds}
  26.   /$C4/$BE/>TST     {          LES       DI,>TST[BP] ; ES:DI to start}
  27.   /$8C/$C0          {          mov       ax,es}
  28.   /$8E/$D8          {          mov       ds,ax}
  29.   /$8A/$86/>SRCH    {          MOV       AL,>SRCH[BP] ; search char}
  30.   /$29/$DB          {          sub       bx,bx     ;zero in bx -- for counting}
  31.   /$29/$C9          {          SUB       CX,CX     ; zero in CX}
  32.   /$8A/$0D          {          MOV       CL,[DI]   ; length in CX}
  33.   /$E3/$0B          {          JCXZ      QUIT      ; exit if null}
  34.   /$47              {          INC       DI        ; first char}
  35.   /$FC              {          CLD                 ; frontwards}
  36.   /$E3/$07          {MORE:     JCXZ      QUIT      ; no more}
  37.   /$F2/$AE          {REPNE     SCASB               ; do search}
  38.   /$75/$03          {          JNE       QUIT      ; not found}
  39.   /$43              {          inc       bx        ;count it}
  40.   /$EB/$F7          {          JMP       MORE      ; try for more}
  41.   /$89/$5E/$0A      {QUIT:     mov       [bp+10],bx ;get function result}
  42.   /$1F              {          pop       ds}
  43. );
  44. end;
  45.  
  46.  
  47. into this:
  48.  
  49. Function Count (var tst; srch:char):integer;
  50. begin
  51. Inline(
  52.   $1E/$C4/$BE/>TST/$8C/$C0/$8E/$D8/$8A/$86/>SRCH/$29/$DB/$29/$C9/$8A/$0D/$E3/
  53.   $0B/$47/$FC/$E3/$07/$F2/$AE/$75/$03/$43/$EB/$F7/$89/$5E/$0A/$1F);
  54. end;
  55.  
  56.      If you use COMSTRIP on STRNFST2.PAS and then get rid of the
  57. remaining comment lines with an editor, you produce a file of
  58. maybe 7-8K, which is a lot quicker to load into Turbo as an
  59. include file.
  60.  
  61.      RESTORE.PAS also takes output from Inline.Com.  It strips
  62. out everything added by Inline.Com.  You therefore wind up with
  63. the original assembly language file used as input to Inline.Com.