[stella] My code is broked!

Subject: [stella] My code is broked!
From: "Chris Larkin" <clarkin@xxxxxxxxxxxxx>
Date: Tue, 7 Oct 2003 19:33:40 -0700
It could just be that I still don't fully understand indirect addressing... But this should work?
 
I know this loop does not replace the first byte in either location, but it should "swap" the others... However
my results are not very good :-) What am I doing wrong?
 
 
PlayerHand = $B0 ; -> $B6
Player3 = $A0 ; -> $A6
 
TradeHands
     LDY #7
     LDA #PlayerHand
     STA tmpVar3
     LDA #Player3
     STA tmpVar4

TradeLoop
     LDA (tmpVar3),y
     STA tmpVar2
     LDA (tmpVar4),y

     STA (tmpVar3),y

     LDA tmpVar2

     STA (tmpVar4),y
     DEY
     BNE TradeLoop
     RTS
 
Current Thread