//ソース5:処理速度改善前(C言語)
unsigned char g_byBuf[10];
void FuncA(unsigned char *pbySrc)
{
unsigned char i;
unsigned char *pbyPtr;
pbyPtr = &g_byBuf[0];
for(i = 0; i < 10; i++)
{
*pbyPtr++ = *pbySrc++;
}
}
|
;ソース6:処理速度改善前(アセンブラ)
_FuncA:
(省略)
;//for(i = 0; i < DATA_SIZE; i++)
mov a,#00H ;4Cycle
mov [hl+1],a ;8Cycle?
?L0011:
mov a,[hl+1] ;8Cycle
cmp a,#0AH ;4Cycle
bnc $?L0012 ;6Cycle
;//*pbyPtr++ = *pbySrc++
mov a,[hl+4] ;8Cycle
xch a,x ;2Cycle
mov a,[hl+5] ;8Cycle
movw de,ax ;4Cycle
incw ax ;4Cycle
mov [hl+5],a ;8Cycle
xch a,x ;2Cycle
mov [hl+4],a ;8Cycle
mov a,[de] ;4Cycle
mov c,a ;2Cycle
mov a,[hl+2] ;8Cycle
xch a,x ;2Cycle
mov a,[hl+3] ;8Cycle
movw de,ax ;4Cycle
incw ax ;4Cycle
mov [hl+3],a ;8Cycle
xch a,x ;2Cycle
mov [hl+2],a ;8Cycle
mov a,c ;2Cycle
mov [de],a ;4Cycle
mov a,[hl+1] ;8Cycle
inc a ;2Cycle
mov [hl+1],a ;8Cycle
br $?L0011 ;6Cycle
?L0012:
(省略)
|