Reference Section
_fmem_ccpy {
char buffer1[20], buffer2[20];
unsigned int num = 20;
...
_mem_ccpy ((void *)buffer1, buffer2, 'A', &num);
}
#include <inline.h>
{
char buffer1[20], buffer2[20];
...
pushss
pop es /* ES = SS */
lea si,buffer1/* DS:SI->buffer1 */
lea di,buffer2/* ES:DI->buffer2 */
mov cx,20
mov al,'A'
mem_ccpy (); /* copy buffer1 to buffer2 */
jc mem_ccpy_010/* if AL not found in block */
... /* if AL found in block */
jmp short mem_ccpy_020
mem_ccpy_010:
... /* 'A' not found in block */
mem_ccpy_020:
...
}
Source file _MMCCPY.ASM ASM equiv MEM_CCPY
{
char buffer[20];
void *pointer;
unsigned int num;
...
pointer = _mem_chr (buffer, 'A', &num);
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20 /* CX = size of buffer */
mov al,'A'
mem_chrdi (); /* search for the character */
jc mem_chr_010/* if AL not found in buffer */
... /* if AL was found in buffer */
mem_chr_010:
...
}
Source file _MMCHR.ASM ASM equiv MEM_CHR
{
char buffer[20];
void *pointer;
unsigned int num;
...
pointer = _mem_chri (buffer, 'A', &num);
}
#include <inline.h>
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
{
char buffer[20];
...
pushss
pop es /* ES=SS */
lea di,buffer
mov cx,20 /* CX=bytes to copy */
mov al,'A' /* AL=character to stop on */
mem_chridi (); /* was char found? */
jc mem_chri_010/* n: continue */
... /* y: handle character */
mem_chri_010:
...
}
Source file _MMCHRI.ASM ASM equiv MEM_CHRI
{
char buffer[20];
void *pointer;
unsigned int num;
...
pointer = _mem_chrn (buffer, 'A', &num);
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20 /* CX = size of buffer */
mov al,'A'
mem_chrndi (); /* search the buffer */
jc mem_chrn_010/* if AL was found in buffer */
... /* if other chr was found */
mem_chrn_010:
...
}
Source file _MMCHRN.ASM ASM equiv MEM_CHRN
{
char buffer[20];
void *pointer;
unsigned int num;
...
pointer = _mem_chrni (buffer, 'A', &num);
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20 /* CX = size of buffer */
mov al,'A'
mem_chrnidi (); /* search the buffer */
jc mem_chrni_010/* if AL was found in buffer */
... /* if other chr was found */
mem_chrni_010:
}
Source file _MMCHRNI.ASM ASM equiv MEM_CHRNI
{
char buffer1[20], buffer2[20];
switch (_mem_cmp (buffer1, (void *)buffer2, 20))
{
case 1:/* buffer1 > buffer2 */
break;
case 0:/* buffer1 == buffer2 */
break;
case -1:/* buffer1 < buffer2 */
break;
}
}
#include <inline.h>
{
char buffer1[20], buffer2[20];
...
pushss
pop es /* ES = SS */
lea si,buffer1/* DS:SI->buffer1 */
lea di,buffer2/* ES:DI->buffer2 */
mov cx,20
mem_cmp (); /* compare buffer1 to buffer2 */
jb mem_cmp_020/* if buffer1 < buffer2 */
je mem_cmp_010/* if buffer1 = buffer2 */
... /* if buffer1 > buffer2 */
jmp short mem_cmp_030
mem_cmp_010:
... /* buffer1 == buffer2 */
jmp short mem_cmp_030
mem_cmp_020:
... /* buffer1 < buffer2 */
mem_cmp_030:
...
}
Source file _MMCMP.ASM ASM equiv MEM_CMP
{
char buffer1[20], buffer2[20];
switch (_mem_cmpi (buffer1, (void *)buffer2, 20))
{
case 1:/* buffer1 > buffer2 */
break;
case 0:/* buffer1 == buffer2 */
break;
case -1:/* buffer1 < buffer2 */
break;
}
}
#include <inline.h>
{
char buffer1[20], buffer2[20];
...
pushss
pop es /* ES = SS */
lea si,buffer1/* DS:SI->buffer1 */
lea di,buffer2/* ES:DI->buffer2 */
mov cx,20
mem_cmpi (); /* compare buffer1 to buffer2 */
jb mem_cmpi_020/* if buffer1 < buffer2 */
je mem_cmpi_010/* if buffer1 = buffer2 */
... /* if buffer1 > buffer2 */
jmp short mem_cmpi_030
mem_cmpi_010:
... /* buffer1 == buffer2 */
jmp short mem_cmpi_030
mem_cmpi_020:
... /* buffer1 < buffer2 */
mem_cmpi_030:
...
}
Source file _MMCMPI.ASM ASM equiv MEM_CMPI
{
char buffer1[20], buffer2[20];
unsigned int num = 20;
...
_mem_cpy ((void *)buffer1, buffer2, num);
}
#include <inline.h>
{
char buffer1[20], buffer2[20];
...
pushss
pop es /* ES = SS */
lea si,buffer1/* DS:SI->buffer1 */
lea di,buffer2/* ES:DI->buffer2 */
mov cx,20
mem_cpy (); /* copy buffer1 to buffer2 */
...
}
Source file _MMCPY.ASM ASM equiv MEM_CPY
{
char buffer1[20], buffer2[20];
void *pointer = _mem_cpye ((void *)buffer1, buffer2, 20);
...
}
#include <inline.h>
{
char buffer1[20], buffer2[20];
...
pushss
pop es /* ES = SS */
lea si,buffer1/* DS:SI->buffer1 */
lea di,buffer2/* ES:DI->buffer2 */
mov cx,20
mem_cpye (); /* ES:DI->end of buffer2 */
...
}
Source file _MMCPYE.ASM ASM equiv MEM_CPYE
{
char buffer[20];
int num = 20;
...
num = _mem_cspn (buffer, (void *)("\4.,:;"+1), num);
/* counts consecutive non-punctuation characters in buffer */
}
#include <inline.h>
{
char buffer[20], *punct = "\4.,:;";
...
pushds
pop es /* ES = DS */
mov di,punct
lea si,buffer/* DS:SI->buffer */
inc di /* ES:DI->string+1 */
mov cx,20 /* CX = size of buffer */
mem_cspn (); /* count consecutive non-punct
... chars in buffer */
}
Source file _MMCSPN.ASM ASM equiv MEM_CSPN
{
char buffer[20];
...
_mem_lwr (buffer, 20);
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20
mem_lwrdi (); /* convert buffer to lowercase */
...
}
Source file _MMLWR.ASM ASM equiv MEM_LWR
{
char buffer1[20], buffer2[20];
void *lookblk = buffer1, *findblk = buffer2;
unsigned int looksize, findsize;
int cond;
lookblk = "Spontaneous Assembly Library";
looksize = sizeof ("Spontaneous Assembly Library");
findblk = "Library";
findsize = sizeof ("Library");
cond = _mem_mem (&lookblk, &looksize, &findblk,
&findsize);
/* cond = 0 */
/* lookblk now points to 'Library' in lookblk */
/* looksize now equals the size of the block
from 'L' in 'Library' (in lookblk) to the
end of the block */
lookblk = "Spontaneous Assembly Library";
looksize = sizeof ("Spontaneous Assembly Library");
findblk = "Library files";
findsize = sizeof ("Library files");
cond = _mem_mem (&lookblk, &looksize, &findblk,
&findsize);
/* cond = 1 */
/* lookblk now points to 'Library' in lookblk */
/* looksize now equals the size of the block
from 'L' in 'Library' to the end of the block */
/* findblk now points to ' files' in findblk */
/* findsize now equals the size of the block from
' ' in ' files' (in findblk) to the end of the block */
}
#include <inline.h>
{
char lookblk[20], findblk[20];
...
pushss
pop es
lea si,findblk/* DS:SI->findblk */
lea di,lookblk/* ES:DI->lookblk */
mov cx,20 /* CX = size of findblk */
mov dx,20 /* DX = size of lookblk */
mem_mem (); /* search the memory block */
je mem_mem_010/* if a match was found */
jb mem_mem_020/* if no match was found */
... /* partial match */
jmp short mem_mem_030
mem_mem_010:
... /* full match */
jmp short mem_mem_030
mem_mem_020:
... /* no match found */
mem_mem_030:
...
}
Source file _MMMEM.ASM ASM equiv MEM_MEM
{
char buffer1[20], buffer2[20];
void *lookblk = buffer1, *findblk = buffer2;
unsigned int looksize, findsize;
int cond;
lookblk = "Spontaneous Assembly Library";
looksize = sizeof ("Spontaneous Assembly Library");
findblk = "library";
findsize = sizeof ("library");
cond = _mem_memi (&lookblk, &looksize, &findblk,
&findsize);
/* cond = 0 */
/* lookblk now points to 'Library' in lookblk */
/* looksize now equals the size of the block from 'L'
(in lookblk) to the end of the block */
lookblk = "Spontaneous Assembly Library";
looksize = sizeof ("Spontaneous Assembly Library");
findblk = "library files";
findsize = sizeof ("library files");
cond = _mem_memi (&lookblk, &looksize, &findblk,
&findsize);
/* cond = 1 */
/* lookblk now points to 'Library' in lookblk */
/* looksize now equals the size of the block from 'L'
(in lookblk) to the end of the block */
/* findblk now points to ' files' in findblk */
/* findsize now equals the size of the block from ' '
(in findblk) to the end of the block */
}
#include <inline.h>
{
char lookblk[20], findblk[20];
...
pushss
pop es
lea si,findblk/* DS:SI->findblk */
lea di,lookblk/* ES:DI->lookblk */
mov cx,20 /* CX = size of findblk */
mov dx,20 /* DX = size of lookblk */
mem_memi (); /* search the memory block */
je mem_memi_010/* if a match was found */
jb mem_memi_020/* if no match was found */
... /* if a partial match */
jmp short mem_memi_030
mem_memi_010:
... /* full match */
jmp short mem_memi_030
mem_memi_020:
... /* no match found */
mem_memi_030:
...
}
Source file _MMMEMI.ASM ASM equiv MEM_MEMI
{
char buffer[20];
...
_mem_mov ((void *)(buffer+1), buffer, 20);
}
#include <inline.h>
{
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer
inc di /* ES:DI->buffer+1 */
lea si,buffer/* DS:SI->buffer */
mov cx,20
mem_mov (); /* move buffer up one byte */
...
}
Source file _MMMOV.ASM ASM equiv MEM_MOV
{
char buffer[20];
void *pointer;
unsigned int num = 20;
...
pointer = _mem_pbrk (buffer, (void *)("\3ABC"+1), &num);
}
#include <inline.h>
{
char buffer[20], *abcset = "\3ABC";
...
pushds
pop es /* ES = DS */
mov di,abcset
inc di /* ES:DI -> string+1 */
lea si,buffer/* DS:SI->buffer */
mov cx,20 /* CX = size of buffer */
mem_pbrk (); /* search for 'A', 'B', or 'C' */
jc mem_pbrk_010/* if a char not found */
... /* if a char found */
mem_pbrk_010:
...
}
Source file _MMPBRK.ASM ASM equiv MEM_PBRK
{
char buffer[20];
void *pointer;
unsigned int num = 20;
...
pointer = _mem_pbrkn (buffer, (void *)("\4.,:;"+1), &num);
/* find first non-punctuation character */
}
#include <inline.h>
{
char buffer[20], *punct = "\4.,:;";
...
pushds
pop es /* ES = DS */
mov di,punct
inc di /* ES:DI -> charset+1 */
lea si,buffer/* DS:SI->buffer */
mov cx,20 /* CX = size of buffer */
mem_pbrkn (); /* find first non-punct char */
jc mem_pbrkn_010/* if all chars matched */
... /* if an unmatched character */
mem_pbrkn_010:
...
}
Source file _MMPBRKN.ASM ASM equiv MEM_PBRKN
{
char buffer[20];
...
_mem_rev (buffer, 20);
...
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
pushss
pop es /* ES = DS */
mov cx,20/* CX = size of buffer */
mem_revdi ();/* reverse bytes in buffer */
...
}
Source file _MMREV.ASM ASM equiv MEM_REV
{
char buffer[20];
_mem_set (buffer, 0, 20);
...
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20
mov al,' '
mem_setdi (); /* set the block to spaces */
...
}
Source file _MMSET.ASM ASM equiv MEM_SET
{
char buffer[20];
void *pointer;
unsigned int num = 20;
...
pointer = _mem_skips (buffer, &num);
...
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20 /* CX = size of buffer */
mem_skipsdi (); /* ES:DI->first non-space char */
...
}
Source file _MMSKIPS.ASM ASM equiv MEM_SKIPS
{
char buffer[20];
void *pointer;
unsigned int num = 20;
...
pointer = _mem_skipw (buffer, &num);
...
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20 /* CX = size of buffer */
mem_skipwdi ();/* ES:DI-> first non-whitespace char */
...
}
Source file _MMSKIPW.ASM ASM equiv MEM_SKIPW
{
char buffer[20];
int num;
...
num = _mem_spn (buffer, (void *)("\3abc"+1),
sizeof (buffer));
}
#include <inline.h>
{
char buffer[20], *abcset = "\3abc";
...
pushds
pop es /* ES = DS */
mov di,string
lea si,buffer/* DS:SI->buffer */
inc di /* ES:DI->string + 1 */
mov cx,20 /* CX = size of buffer */
mem_spn (); /* find number of non-abc chars */
...
}
Source file _MMSPN.ASM ASM equiv MEM_SPN
{
char buffer[20];
pointer = _mem_swab ((void *)buffer, buffer, 20);
...
}
#include <inline.h>
{
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov si,di
mov cx,20
mem_swab ();
...
}
Source file _MMSWAB.ASM ASM equiv MEM_SWAB
{
char buffer[20];
...
_mem_upr (buffer, 20);
}
#include <inline.h>
{
/* use "ES:DI" version of function to minimize reg profile, */
/* see SA 3.0 manual for more details */
char buffer[20];
...
pushss
pop es /* ES = SS */
lea di,buffer/* ES:DI->buffer */
mov cx,20
mem_uprdi (); /* convert buffer to uppercase */
...
}
Source file _MMUPR.ASM ASM equiv MEM_UPR