Sine generator problem.
Posted: Thu Jun 10, 2010 3:16 pm
Why doesn't this work??
skp run,endset ;do not execute if already running
wrax sin,0 ;set sin to 0, (acc should be zero)
sof 0,-1 ;set accum to -1
wrax cos,0 ;write to cos
endset: ;jump-to label
rdax sin,1 ;read the sin register
mulx pot0 ;multiply by pot value
rdax cos,1 ;read the cos register
wrax cos,-1 ;integrate the cos value, pass on *-1
mulx pot0 ;multiply by pot value
rdax sin,1 ;read sin reg
wrax sin,1 ;integrate the sin value
ldax sin
wrax adcl, 0
skp run,endset ;do not execute if already running
wrax sin,0 ;set sin to 0, (acc should be zero)
sof 0,-1 ;set accum to -1
wrax cos,0 ;write to cos
endset: ;jump-to label
rdax sin,1 ;read the sin register
mulx pot0 ;multiply by pot value
rdax cos,1 ;read the cos register
wrax cos,-1 ;integrate the cos value, pass on *-1
mulx pot0 ;multiply by pot value
rdax sin,1 ;read sin reg
wrax sin,1 ;integrate the sin value
ldax sin
wrax adcl, 0