Software questions and issues with the FV-1
Moderator: frank
the_boris
Posts: 2 Joined: Sun Nov 18, 2012 7:56 am
Location: United States
Post
by the_boris » Fri Dec 05, 2014 5:02 pm
I'm a bit confused by what values of POT0-2 are supposed to be. According to docs and forum posts, the values are 0-1. But when I use a coefficient that represents the same range of values, the behaviors are not at all the same. Below is an example of a basic script where POT2 is a volume pot. If instead of POT2 I use the VOLUME coefficient, it doesn't work.
Code: Select all
equ VOLUME .75
rdax adcl, .5
rdax adcr, .5
mulx pot2 ;works
;mulx VOLUME ; doesn't work.
wrax dacl, 1
wrax dacr, 0
Boris
frank
Posts: 1244 Joined: Wed Oct 19, 2005 12:26 pm
Contact:
Post
by frank » Fri Dec 05, 2014 5:11 pm
MULX requires the parameter to be a register and not a constant so you would need to save 0.75 in to a register called VOLUME then use it like:
Code: Select all
equ VOLUME .15
equ volreg reg0
sof 0,VOLUME
wrax volreg, 0 ; load VOLUME value into register
rdax adcl, .5
rdax adcr, .5
;mulx pot2 ;works
mulx volreg ; works with register
wrax dacl, 1
wrax dacr, 0
If you want to use VOLUME as a coefficient directly then use sof or other instruction that takes a coefficient directly
the_boris
Posts: 2 Joined: Sun Nov 18, 2012 7:56 am
Location: United States
Post
by the_boris » Mon Dec 08, 2014 1:59 pm
perfect! thank you!
my background in higher level programming made me assume that a constant and a variable are interchangeable.
Boris