Hello,
I am stumped on what to do to simplify some code I am working on. CS1H CPU.
I will try to explain what I am going for here.
Currently there is some code with a bunch of compares that I have to add "Variations" to. It basically says...
D100=110 ---OUT 0.00
D100=115 ---OUT 0.01
D100=118 ---OUT 0.02
There are currently a bunch of these lines with a bunch of different "variation" values turning on bits.
I know there has to be a quick way to do this so future addition of "variations" 112, 113, 127... doesn't mean going in and adding individual lines or rewriting it all to line up.
The instruction I mentally picture but cant find outputs a bit based on the value in D100.
A bad example of this would be if D100=12 turn on 0.12 but if D100=23 turn on 1.06
I hope I explained this well enough.