lda K ldy L jsr mult ;K*L = (byte low, byte high) = (x reg, accu) stx ZP lsr ;/2 ror ZP lsr ;/4 ror ZP lsr ;/8 ror ZP lsr ;/16 ror ZP lda ZP sta M
;this bit only when we change volume ldx #B (volume 0-16) lda volumetable,x sta sbcadress+1 eor #$ff clc adc #1 sta ldaadress+1
;this is for multiplying one sample value ldx sampledata (stored as inverse sines) ldaadress: lda COSTABLE+256-y,x (the -y is done by modifying the adress) sec sbcadress: sbc COSTABLE+y,x (the +y is done by modifying the adress) ror