Reference Section
_fstr_cat {
char string1[10], string2[10];
...
_str_cat (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
str_cat ();
...
}
Source file _STRCAT.ASM ASM equiv STR_CAT
{
char string1[10], string2[10];
...
_str_cate (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
str_cate ();/* DI -> end of string1 */
...
}
Source file _STRCATE.ASM ASM equiv STR_CATE
#include <sastring.h>
{
char string[11];
...
_put_str(_str_center("Hello!", ' ', 10)); /* " Hello! "*/
...
}
#include <inline.h>
{
char string[11] = "hello!";
...
lea si,string/* SI = offset of string */
mov cl,10 /* CL = width */
mov al," " /* AL = pad character */
str_center(); /* center align string */
put_str(); /* " Hello! " */
...
}
Source file _STRCNTR.ASM ASM equiv STR_CENTER
{
char string[10], look;
char *pointer;
...
pointer = _str_chr (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_chr (); /* SI = offset of first
occurrence of look */
jncstr_chr_010/* if look was found */
... /* if look wasn't found */
jmp short str_chr_020
str_chr_010:
... /* if look was found */
str_chr_020:
...
}
Source file _STRCHR.ASM ASM equiv STR_CHR
{
char string[10], look;
char *pointer;
...
pointer = _str_chri (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_chri ();/* DS:SI -> 1st occurrence of look */
jncstr_chri_010 /* if look was found */
... /* if look wasn't found */
jmp short str_chri_020
str_chri_010:
... /* if look was found */
str_chri_020:
...
}
Source file _STRCHRI.ASM ASM equiv STR_CHRI
{
char string[10], look;
char *pointer;
...
pointer = _str_chrn (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_chrn (); /* SI = offset of first
non-occurrence of look */
jncstr_chrn_010/* if no chars matched look */
... /* if all chars matched look */
jmp short str_chrn_020
str_chrn_010:
... /* if no chars matched look */
str_chrn_020:
...
}
Source file _STRCHRN.ASM ASM equiv STR_CHRN
{
char string[10], look;
char *pointer;
...
pointer = _str_chrni (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_chrni (); /* SI = offset of first
non-occurrence of look */
jncstr_chrni_010/* if no chars matched look */
... /* if all chars matched look */
jmp short str_chrni_020
str_chrni_010:
... /* no matching chars found */
str_chrni_020:
...
}
Source file _STRCHNI.ASM ASM equiv STR_CHRNI
{
char string1[10], string2[10];
...
switch (_str_cmp (string1, string2))
{
case 1: /* string1 > string2 */
break;
case 0: /* string1 = string2 */
break;
case -1: /* string1 < string2 */
break;
}
}
#include <inline.h>
{
<char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_cmp ();
je str_cmp_010/* if string1 = string2 */
jb str_cmp_020/* if string1 < string2 */
... /* if string1 > string2 */
jmp short str_cmp_030
str_cmp_010:
... /* string1 = string2 */
jmp short str_cmp_030
str_cmp_020:
... /* string1 < string2 */
str_cmp_030:
...
}
Source file _STRCMP.ASM ASM equiv STR_CMP
{
char string1[10], string2[10];
...
switch (_str_cmpi (string1, string2))
{
case 1:/* string1 > string2, case insensitive */
break;
case 0:/* string1 = string2, case insensitive */
break;
case -1:/* string1 < string2, case insensitive */
break;
}
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_cmpi ();
je str_cmpi_010/* if string1 = string2 */
jb str_cmpi_020/* if string1 < string2 */
... /* if string1 > string2 */
jmp short str_cmpi_030
str_cmpi_010:
... /* string1 = string2 */
jmp short str_cmpi_030
str_cmpi_020:
... /* string1 < string2 */
str_cmpi_030:
...
}
Source file _STRCMPI.ASM ASM equiv STR_CMPI
{
char string1[10], string2[10];
...
_str_cpy (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1/* ES:DI -> string1 */
lea si,string2/* DS:SI -> string2 */
str_cpy (); /* copy string2 into string1 */
...
}
Source file _STRCPY.ASM ASM equiv STR_CPY
{
char string1[10], string2[10], *pointer;
...
pointer = _str_cpye (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
str_cpye ();/* ES:DI -> end of string1 */
...
}
Source file _STRCPYE.ASM ASM equiv STR_CPYE
{
char string1[10], string2[10];
int num;
...
num = _str_cspn (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string2
lea si,string1
str_cspn (); /* CX=number of matching chars */
...
}
Source file _STRCSPN.ASM ASM equiv STR_CSPN
{
char string[10];
int length;
...
_str_drive (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_drive ();/* DS:SI -> drive specifier,
CX=length */
...
}
Source file _STRDRIV.ASM ASM equiv STR_DRIVE
{
char string[10];
int length;
...
_str_drvpath (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_drvpath ();/* DS:SI -> drive/path specifier,
CX=length */
...
}
Source file _STRDPTH.ASM ASM equiv STR_DRVPATH
{
char string[10], *pointer;
...
pointer = _str_end (string);
}
#include <inline.h>
{
char string[10];
...
pushss
pop es /* ES = SS */
lea di,string
str_enddi ();/* ES:DI -> end of string */
...
}
Source file _STREND.ASM ASM equiv STR_ENDDI
{
char string[10];
int length;
...
_str_ext (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_ext ();/* SI = offset of extension in string,
CX=length */
...
}
Source file _STREXT.ASM ASM equiv STR_EXT
{
char string[10];
int length;
...
_str_fname (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_fname ();/* SI = offset of filename portion of
string, CX=length */
...
}
Source file _STRFNAM.ASM ASM equiv STR_FNAME
{
char string[10];
int length;
...
_str_fnamext (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_fnamext ();/* SI = offset of filename.ext portion
of string, CX=length */
...
}
Source file _STRFNEX.ASM ASM equiv STR_FNAMEXT
#include <sastring.h>
{
char string[11];
...
_put_str(_str_left("Hello!", ' ', 10)); /* "Hello! " */
...
}
#include <inline.h>
{
char string[11] = "hello!";
...
lea si,string/* SI = offset of string */
mov cl,10 /* CL = width */
mov al," " /* AL = pad character */
str_left(); /* left align string */
put_str(); /* "Hello! " */
...
}
Source file _STRLEFT.ASM ASM equiv STR_LEFT
{
char string[10];
int length;
...
length = _str_len (string);
}
#include <inline.h>
{
char string[] = "Length of this string";
...
pushss
pop es /* ES = SS */
lea di,string
str_lendi ();/* CX=string length */
...
}
Source file _STRLEN.ASM ASM equiv STR_LENDI
{
char string[10];
...
_str_lwr (string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_lwr ();
...
}
Source file _STRLWR.ASM ASM equiv STR_LWR
{
char string1[10], string2[10];
...
_str_ncat (string1, string2, 5);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
mov cx,5
str_ncat ();/* CX=number of characters copied */
...
}
Source file _STRNCAT.ASM ASM equiv STR_NCAT
{
char string1[10], string2[10], *pointer;
...
pointer = _str_ncate (string1, string2, 5);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
mov cx,5
str_ncate ();/* CX=# of chars copied,
DI -> end of string1 */
...
}
Source file _STRNCTE.ASM ASM equiv STR_NCATE
{
char string1[10], string2[10];
int num;
...
switch (_str_ncmp (string1, string2, num))
{
case 1:/* first num chars of string1 > string2 */
break;
case 0:/* first num chars of string1 = string2 */
break;
case -1:/* first num chars of string1 < string2 */
break;
}
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
mov cx,5
str_ncmp ();
je str_ncmp_010/* if first num chars of
string1 = string2 */
jb str_ncmp_020/* if first num chars of
string1 < string2 */
... /* if first num chars of
string1 > string2 */
jmp short str_ncmp_030
str_ncmp_010:
jmp short str_ncmp_030
str_ncmp_020:
... /* first num chars of
string1 < string2 */
str_ncmp_030:
...
}
Source file _STRNCMP.ASM ASM equiv STR_NCMP
{
char string1[10], string2[10];
int num;
...
switch (_str_ncmpi (string1, string2, num))
{
case 1:/* first num chars of string1 > string2 */
break;
case 0:/* first num chars of string1 = string2 */
break;
case -1:/* first num chars of string1 < string2 */
break;
}
}
#include <inline.h>
{
char string1[10], string2[10];
int num;
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_ncmpi ();
je str_ncmpi_010/* string1 = string2 */
jb str_ncmpi_020/* string1 < string2 */
... /* string1 > string2 */
jmp short str_ncmpi_030
str_ncmpi_010:
... /* string1 = string2, case insensitive */
jmp short str_ncmpi_030
str_ncmpi_020:
... /* string1 = string2, case insensitive */
str_ncmpi_030:
...
}
Source file _STRNCPI.ASM ASM equiv STR_NCMPI
{
char string1[10], string2[10];
...
_str_ncpy (string1, string2, 5);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea di,string1
lea si,string2
mov cx,5
str_ncpy ();/* CX=number of characters copied */
...
}
Source file _STRNCPY.ASM ASM equiv STR_NCPY
{
char string1[10];
...
_str_nset (string1, ' ', 9);
}
#include <inline.h>
{
char string1[10], init;
...
lea si,string1
mov al,' '
mov cx,5
str_nset ();/* CX=number of characters set to AL */
...
}
Source file _STRNSET.ASM ASM equiv STR_NSET
{
char string[10];
int length;
...
_str_path (string, &length);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_path ();/* SI = offset of path specifier
in string, CX=length */
...
}
Source file _STRPATH.ASM ASM equiv STR_PATH
{
char string1[10], string2[10], *pointer;
...
pointer = _str_pbrk (string1, string2);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_pbrk (); /* SI = offset of first char in
string1 that matches a char
from string2 */
jc str_pbrk_010/* if no match found */
...
str_pbrk_010:
...
}
Source file _STRPBRK.ASM ASM equiv STR_PBRK
{
char string1[10], string2[10], *pointer;
...
pointer = _str_pbrkn (string1, string2);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_pbrkn (); /* SI = offset of first char in
string1 that doesn't matches
a char from string2 */
jc str_pbrkn_010/* string1 == string2 */
...
str_pbrkn_010:
...
}
Source file _STRPBKN.ASM ASM equiv STR_PBRKN
{
char string[10], look;
char *pointer;
...
pointer = _str_rchr (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_rchr (); /* SI = offset of last occurrence
of look */
jc str_rchr_010/* if no match found */
...
str_rchr_010:
...
}
Source file _STRRCH.ASM ASM equiv STR_RCHR
{
char string[10], look;
char *pointer;
...
pointer = _str_rchri(string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_rchri(); /* SI = offset of last occurrence
of look */
jc str_rchr_010/* if no match found */
...
str_rchr_010:
...
}
Source file _STRRCHI.ASM ASM equiv STR_RCHRI
{
char string[10], look;
char *pointer;
...
pointer = _str_rchrn (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_rchrn (); /* SI = offset of last
non-occurrence of look */
jc str_rchrn_010/* all chars match look */
...
str_rchrn_010:
...
}
Source file _STRRCHN.ASM ASM equiv STR_RCHRN
{
char string[10], look;
char *pointer;
...
pointer = _str_rchrni (string, look);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[10], look;
...
lea si,string
mov al,look
str_rchrni (); /* SI = offset of last
non-occurrence of look */
jc str_rchrni_010/* all chars match look */
...
str_rchrni_010:
...
}
Source file _STRRCNI.ASM ASM equiv STR_RCHRNI
{
char string[10];
...
_str_rev (string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_rev ();
...
}
Source file _STRREV.ASM ASM equiv STR_REV
#include <sastring.h>
{
char string[11];
...
_put_str(_str_right("Hello!", ' ', 10)); /* " Hello!" */
...
}
#include <inline.h>
{
char string[11] = "hello!";
...
lea si,string/* SI = offset of string */
mov cl,10 /* CL = width */
mov al," " /* AL = pad character */
str_right(); /* right align string */
put_str(); /* " Hello!" */
...
}
Source file _STRRGHT.ASM ASM equiv STR_RIGHT
{
char string1[10];
...
_str_set (string1, ' ');
}
#include <inline.h>
{
char string1[10];
...
lea si,string1
mov al,' '
str_set ();
...
}
Source file _STRSET.ASM ASM equiv STR_SET
{
char string[10];
...
_str_skips (string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_skips ();/* DS:SI -> first non-space character */
...
}
Source file _STRSKPS.ASM ASM equiv STR_SKIPS
{
char string[10];
...
_str_skipw (string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_skipw ();/* SI = offset of first non-whitespace
character */
...
}
Source file _STRSKPW.ASM ASM equiv STR_SKIPW
{
char string1[10], string2[10];
int num;
...
num = _str_spn (string1, string2);
}
#include <inline.h>
{
char string1[10], string2[10];
...
pushss
pop es /* ES = SS */
lea si,string1
lea di,string2
str_spn ();/* CX=number of matching characters */
...
}
Source file _STRSPN.ASM ASM equiv STR_SPN
{
char string[100], substring[10], *pointer;
...
pointer = _str_str (string, substring);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[100], substring[10];
...
pushss
pop es /* ES = SS */
lea si,string
lea di,substring
str_str (); /* SI = offset of first occurrence
of substr in string */
jc str_str_010/* if substr not found in str */
...
str_str_010:
...
}
Source file _STRSTR.ASM ASM equiv STR_STR
{
char string[100], substring[10], *pointer;
...
pointer = _str_stri (string, substring);
if (pointer == NULL)
{
...
} else
{
...
}
}
#include <inline.h>
{
char string[100], substring[10];
...
pushss
pop es /* ES = SS */
lea si,string
lea di,substring
str_stri (); /* SI = offset of first occurrence
of substr in string */
jc str_stri_010/* if substr not found in str */
...
str_stri_010:
...
}
Source file _STRSTRI.ASM ASM equiv STR_STRI
{
char buffer[100], delimiters[10], *pointer;
...
_str_toks(buffer);
while ((pointer = _str_tok (delimiters)) != NULL)
{
...
}
}
#include <inline.h>
{
char buffer[100], delimiters[10];
...
pushss
pop es /* ES = SS */
lea si,buffer
str_toks ();
lea di,delimiters
str_tok_010:
str_tok (); /* DS:SI -> next token */
jb str_tok_020/* if no more tokens */
je str_tok_010/* if a NULL token was found */
... /* process tokens here */
jmp str_tok_010
str_tok_020:
...
}
Source file _STRTOK.ASM ASM equiv STR_TOK
{
char buffer[100], delimiters[10], *pointer;
...
_str_toks(buffer);
while ((pointer = _str_tok (delimiters)) != NULL)
{
...
}
}
#include <inline.h>
{
char buffer[100], delimiters[10];
...
pushss
pop es /* ES = SS */
lea si,buffer
str_toks ();
lea di,delimiters
str_tok_010:
str_tok (); /* DS:SI -> next token */
jb str_tok_020/* if no more tokens */
je str_tok_010/* if a NULL token was found */
... /* process tokens here */
jmp str_tok_010
str_tok_020:
...
}
Source file _STRTOK.ASM ASM equiv STR_TOKS
{
char string[10];
...
_str_trims(string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_trims ();
...
}
Source file _STRTRMS.ASM ASM equiv STR_TRIMS
{
char string[10];
...
_str_trimw(string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_trimw ();
...
}
Source file _STRTRMW.ASM ASM equiv STR_TRIMW
{
char string[10];
...
_str_upr(string);
}
#include <inline.h>
{
char string[10];
...
lea si,string
str_upr();
...
}
Source file _STRUPR.ASM ASM equiv STR_UPR