Category : Pascal Source Code
Archive   : PSRCH10.ZIP
Filename : PSEARCH.PAS

 
Output of file : PSEARCH.PAS contained in archive : PSRCH10.ZIP
unit PSearch;

{

Palcic Search Routines, v1.00
Copyright (C) 1989, MJP Enterprises

Assembler: Turbo Assembler 1.01
Compiler: Turbo Pascal 5.5
Computer: TenStar 286
Dos Ver: MS-DOS 4.01
Display: Vega VGA

Matthew J. Palcic
1030 Dayton-Yellow Springs Rd.
Xenia, OH 45385-9508

}

interface

const
NotFound = $FFFF;

function FindLong(var Source; Len: Word; L: Longint): Word;
Inline(
$58/ { pop ax }
$5B/ { pop bx }
$59/ { pop cx }
$5F/ { pop di }
$07/ { pop es }
$03/$F9/ { add di,cx }
$83/$EF/$04/ { sub di,4 }
$83/$E9/$03/ { sub cx,3 }
$FD/ { std }
{ Search: }
$F2/$AE/ { repne scasb }
$75/$10/ { jne Abort }
$26/$39/$45/$01/ { cmp es:[di+1],ax }
$75/$F6/ { jne Search }
$26/$39/$5D/$03/ { cmp es:[di+3],bx }
$75/$F0/ { jne Search }
$8B/$C1/ { mov ax,cx }
$EB/$04/ { jmp SHORT Exit }
{ Abort: }
$B8/$FF/$FF/ { mov ax,0FFFFh }
{ Exit: }
$FC); { cld }

function FindWord(var Source; Len: Word; W: Word): Word;
Inline(
$58/ { pop ax }
$59/ { pop cx }
$5F/ { pop di }
$07/ { pop es }
$03/$F9/ { add di,cx }
$83/$EF/$02/ { sub di,2 }
$49/ { dec cx }
$FD/ { std }
{ Search: }
$F2/$AE/ { repne scasb }
$75/$0A/ { jne Abort }
$26/$39/$45/$01/ { cmp es:[di+1],ax }
$75/$F6/ { jne Search }
$8B/$C1/ { mov ax,cx }
$EB/$04/ { jmp SHORT Exit }
{ Abort: }
$B8/$FF/$FF/ { mov ax,0FFFFh }
{ Exit: }
$FC); { cld }

implementation

end.


  3 Responses to “Category : Pascal Source Code
Archive   : PSRCH10.ZIP
Filename : PSEARCH.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/