|
Atari coding BBS
move16 bug ? |
Posted by: Orion_
|
Jan,28.2015-18:32
|
Hello,
I'm trying to optimize a copy routine using move16 but I get random bugs, it seems that sometimes not all the data are copied.
Example, this routine works:
.loop:
move.l (a0)+,d1 ; *indexRef++
lsl.l #5,d1 ; *32 (C3D_Triangle struct size)
lea (a1,d1.l),a3 ; inTlist[*indexRef++]
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
move.l (a3)+,(a2)+
subq.l #1,d0 ; n--;
bne.s .loop ; while (n);
But If I use this one, it seems that some data are not copied. (a3/a2 buffer are malloced, so it should be aligned correctly)
.loop:
move.l (a0)+,d1 ; *indexRef++
lsl.l #5,d1 ; *32 (C3D_Triangle struct size)
lea (a1,d1.l),a3 ; inTlist[*indexRef++]
move16 (a3)+,(a2)+ ; *outTlist++ = inTlist[*indexRef++];
subq.l #1,d0 ; n--;
move16 (a3)+,(a2)+
bne.s .loop ; while (n);
(I tried to put the subq in between the move16, but it doesn't help)
any guess ?
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|