Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual
Page 192

High-Speed Microcontroller User’s
Guide: Network Microcontroller
Supplement
192
mem_compare
Description:
int mem_compare(
void *block0,
/* pointer to the start of block0 */
void *block1,
/* pointer to the start of block1 */
int length);
/* length of data to be compared */
The
mem_compare function compares two blocks of memory, block0 and block1, for length bytes. This function returns 0 in
the accumulator if the two memory blocks are identical, nonzero otherwise.
add_dptr0/add_dptr1
Descriptions:
void add_dptr0(
void *dptr0,
/* dptr0 pointer */
int value);
/* value to be added to pointer */
void add_dptr1(
void *dptr1,
/* dptr1 pointer */
int value);
/* value to be added to pointer */
The
add_dptr0/add_dptr1 function adds a value to current dptr0 or dptr1, depending upon which function is called.
sub_dptr0/sub_dptr1
Descriptions:
void sub_dptr0(
void *dptr0,
/* dptr0 pointer */
int value);
/* value to be subtracted from pointer */
void sub_dptr1(
void *dptr1,
/* dptr1 pointer */
int value);
/* value to be subtracted from pointer */
The
sub_dptr0/sub_dptr1 function subtracts a value from current dptr0 or dptr1, depending upon which function is called.
INPUT
DESCRIPTION
OUTPUT
DESCRIPTION
B:ACC
DPTR0 or
DPTR1
value
*dptr0 (for sub_dptr0) or
*dptr1 (for sub_dptr1)
DPTR0 or
DPTR1
Pointer return value
Example:
MOV B, #01h
CLR A
MOV DPTR, #ENDPTR
ROMCALL sub_dptr0
INPUT
DESCRIPTION
OUTPUT
DESCRIPTION
B:ACC
DPTR0 or
DPTR1
value
*dptr0 (for add_dptr0) or
*dptr1 (for add_dptr1)
DPTR0 or
DPTR1
Pointer return value
Example:
MOV B, #01h
CLR A
MOV DPTR, #STARTPTR
ROMCALL add_dptr0
INPUT
DESCRIPTION
OUTPUT
DESCRIPTION
B:ACC
DPTR0
DPTR1
length
*block0
*block1
ACC
Return value (= 0 if equal)
Example:
MOV B, #high(MEMLENGTH)
MOV A, #low(MEMLENGTH)
MOV DPTR, #BLOCK0
INC DPS
MOV DPTR, #BLOCK1
INC DPS
ROMCALL mem_compare
Maxim Integrated