setup: lda #$ff sta $d40e sta $d40f rts nmi_handler: sta save_a+1 stx save_x+1 lda #$11 ldx #$09 sta $d40b stx $d40b lda #$17 ldx #$07 sta $d404 stx $d404 lda #$08 ldx #$00 sta $d412 stx $d412 ; compute/fetch sample into a... sta $d401 sta $d408 lda #$01 sta $d40b save_x ldx #0 save_a lda #0 jmp $dd0c ; ack + rti