Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
497
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
memcmp
memcpy
memmove
Prototype
function memcmp(p1, p2 : ^byte; n : word) : short;
Description
The function returns a positive, negative, or zero value indicating the relation-
ship of first n words of memory areas starting at addresses p1 and p2.
This function compares two memory areas starting at addresses p1 and p2 for n
words and returns a value indicating their relationship as follows:
Value     Meaning
< 0       p1 "less than" p2
= 0       p1 "equal to" p2
> 0       p1 "greater than" p2
The value returned by the function is determined by the difference between the
values of the first pair of words that differ in the strings being compared.
For parameters p1 and p2 you can use either a numerical value (literal/vari-
able/constant) indicating memory address or a dereferenced value of an object,
for 
example @mystring or @PORTB.
Prototype
procedure memcpy(p1, p2 : ^byte; nn : word);
Description
The function copies nn words from the memory area starting at the address p2
to the memory area starting at p1. If these memory buffers overlap, the memcpy
function cannot guarantee that words are copied before being overwritten. If
these buffers do overlap, use the memmove function.
For parameters p1 and p2 you can use either a numerical value (literal/vari-
able/constant) indicating memory address or a dereferenced value of an object,
for example
@mystring or @PORTB
.
Prototype
procedure memmove(p1, p2 : ^byte; nn : word);
Description
The function copies nn words from the memory area starting at the address p2 to
the memory area starting at p1. If these memory buffers overlap, the Memmove
function ensures that the words in p2 are copied to p1 before being overwritten.
For parameters p1 and p2 you can use either a numerical value (literal/vari-
able/constant) indicating memory address or a dereferenced value of an object,
for example 
@mystring or @PORTB
.