LQ Newbie
Registered: Jul 2004
Posts: 10
Rep:
|
Who can help me to solve this problem?
I am trying to test my asm code, but I met a strange problem. I have two codes, the only one difference between them is the first one caculate two numbers and the later does four. But the results of them are so different. The first one can run, but the second died.
Since I do this in an embedded enviroment, and I lack the debugging experience under it, so could anyone help me on this problem£¿
What is the problem?
Thank you very much!
1st:
__asm__("
move.l #0x00000080, %%MACSR;
move.w #0x00, %%CCR;
move.l %1, %%a0; /*win_cos_l*/
move.l %2, %%a1; /*out*/
/*add.l #2448, %%a0;
add.l #68, %%a1;*/
move.l #18, %%d0; /*counter*/
LOOP_ONE:
move.l #0,%%acc;
move.l %3,%%a2; /*in*/
move.l (%%a0),%%a3; /*1st cycle*/
move.l (%%a2),%%d3;
mac.l %%d3, %%a3;
move.l (4,%%a0),%%a4;
move.l (4,%%a2),%%d4;
mac.l %%d4, %%a4;
/*move.l (8,%%a0),%%a5;
move.l (8,%%a2),%%d5;
mac.l %%d5, %%a5;
move.l (12,%%a0),%%a6;
move.l (12,%%a2),%%d6;
mac.l %%d6, %%a6;*/
move.l %%acc, %%d1;
move.l %%d1, (%%a1);
subi.l #1, %%d0;
bne LOOP_ONE;
"
:"=m" ((out))
:"r" (win_cos_l),"r"(out),"r"(in));
2nd:
__asm__("
move.l #0x00000080, %%MACSR;
move.w #0x00, %%CCR;
move.l %1, %%a0; /*win_cos_l*/
move.l %2, %%a1; /*out*/
/*add.l #2448, %%a0;
add.l #68, %%a1;*/
move.l #18, %%d0; /*counter*/
LOOP_ONE:
move.l #0,%%acc;
move.l %3,%%a2; /*in*/
move.l (%%a0),%%a3; /*1st cycle*/
move.l (%%a2),%%d3;
mac.l %%d3, %%a3;
move.l (4,%%a0),%%a4;
move.l (4,%%a2),%%d4;
mac.l %%d4, %%a4;
move.l (8,%%a0),%%a5;
move.l (8,%%a2),%%d5;
mac.l %%d5, %%a5;
move.l (12,%%a0),%%a6;
move.l (12,%%a2),%%d6;
mac.l %%d6, %%a6;
move.l %%acc, %%d1;
move.l %%d1, (%%a1);
subi.l #1, %%d0;
bne LOOP_ONE;
"
:"=m" ((out))
:"r" (win_cos_l),"r"(out),"r"(in));
|