使用ti-cgt-c2000_V5.2.1编译程序正常运行,改用ti-cgt-c2000_V6.4.12编译器或是其他高版本编译器,编译的文件无法正常运行,调试中程序流有问题。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
使用ti-cgt-c2000_V5.2.1编译程序正常运行,改用ti-cgt-c2000_V6.4.12编译器或是其他高版本编译器,编译的文件无法正常运行,调试中程序流有问题。
void *memcpy(void *to, const void *from, size_t n)
{
register char *rto = (char *) to;
register char *rfrom = (char *) from;
register unsigned int rn;
register unsigned int nn = (unsigned int) n;
/***********************************************************************/
/* Copy up to the first 64K. At the end compare the number of chars */
/* moved with the size n. If they are equal return. Else continue to */
/* copy the remaining chars. */
/***********************************************************************/
for (rn = 0; rn < nn; rn++) *rto++ = *rfrom++;
if (nn == n) return (to);
/***********************************************************************/
/* Write the memcpy of size >64K using nested for loops to make use */
/* of BANZ instrunction. */
/***********************************************************************/
{
register unsigned int upper = (unsigned int)(n >> 16);
register unsigned int tmp;
for (tmp = 0; tmp < upper; tmp++)
{
for (rn = 0; rn < 65535; rn++)
*rto++ = *rfrom++;
*rto++ = *rfrom++;
}
}
return (to);
}
//将该方法复制到c文件中,运行正常了。 不知道什么原因。 是不是高版本的改方法存在不兼容,或是没有该方法。