Skip to content
Clément Gallet edited this page Mar 22, 2015 · 2 revisions
  • Messing up with address $4001,X (X=0..3)
  • Does not alter the stack
$C1/029F A5 10       LDA $10
$C1/02A1 C9 05       CMP #$05
$C1/02A3 F0 0C       BEQ $0C    [$02B1]
$C1/02A5 A9 FF       LDA #$FF
$C1/02A7 85 12       STA $12
--- Entry point ---
$C1/02A9 20 B2 02    JSR $02B2
$C1/02AC E6 10       INC $10
$C1/02AE 4C 9F 02    JMP $029F
$C1/02B1 60          RTS


$C1/02B2 7B          TDC                     
$C1/02B3 AA          TAX                     
$C1/02B4 BD 01 40    LDA $4001,x
$C1/02B7 C5 10       CMP $10
$C1/02B9 F0 08       BEQ $08    [$02C3]      
$C1/02BB E8          INX                     
$C1/02BC E0 04 00    CPX #$0004              
$C1/02BF D0 F3       BNE $F3    [$02B4]      
$C1/02C1 18          CLC                     
$C1/02C2 60          RTS                     
$C1/02C3 A5 12       LDA $12
$C1/02C5 9D 01 40    STA $4001,x
$C1/02C8 38          SEC                     
$C1/02C9 60          RTS                     
Clone this wiki locally