Dead Hackers Society
Other BBSes »
 
 

68k Inside

Sommarhack 2024

Silly Venture 2024 SE
Demoscene  Coding  CT60  Buy/sell

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]

Topic Posted by  Date 
move16 bug ? Orion_ Jan,28.2015-18:32
  Re: move16 bug ? dml Jan,28.2015-20:18
    Re: move16 bug ? ggn Jan,28.2015-20:50
      Re: move16 bug ? PeP Jan,29.2015-19:04
        Re: move16 bug ? Orion_ Jan,31.2015-13:40


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

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.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson