home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOL_INC.ZIP / STOLOWER.INC < prev    next >
Encoding:
Text File  |  1988-01-29  |  1.0 KB  |  38 lines

  1.  
  2. (*--------------------------------------------------------
  3.  *
  4.  *   map string to lower case
  5.  *   S.H.Smith, 25-oct-87
  6.  *
  7.  *)
  8.  
  9. procedure stolower(var st: anystring);
  10. begin
  11.  
  12.    Inline(
  13.      $C4/$7E/$04/           {   les di,[bp]4         ;es:di -> st[0]}
  14.      $26/                   {   es:}
  15.      $8A/$0D/               {   mov cl,[di]          ;cl = length}
  16.      $FE/$C1/               {   inc cl}
  17.  
  18.                             {next:}
  19.      $47/                   {   inc di}
  20.      $FE/$C9/               {   dec cl}
  21.      $74/$12/               {   jz ends}
  22.      $26/                   {   es:}
  23.  
  24.      $8A/$05/               {   mov al,[di]}
  25.      $3C/$41/               {   cmp al,'A'}
  26.      $72/$F4/               {   jb next}
  27.      $3C/$5A/               {   cmp al,'Z'}
  28.      $77/$F0/               {   ja next}
  29.  
  30.      $04/$20/               {   add al,' '}
  31.      $26/                   {   es:}
  32.      $88/$05/               {   mov [di],al}
  33.      $EB/$E9);              {   jmp next}
  34.                             {ends:}
  35.  
  36. end;
  37.  
  38.