Big Country Posted August 31, 2006 Report Posted August 31, 2006 I want to combine the value of two thumbwheel switches, I'm sure this is simple enough but for some reason it has stummped me. So if I have a 2 on thumbwheel #1 and I have a 8 on thumbwheel #2 I would like to move both of those numbers into a register and it display 28. Then move that into a timer. Thanks in advance! Quote
FNMdeJong Posted September 1, 2006 Report Posted September 1, 2006 Use the instruction BIN to get the values from the thumbwheels seperate into two dataregisters. Next you can multiply the value from thumbwheel 1 by K10 and add both together. Or do a bitshift left by 8. on the value from thumbwheel 1 and add them. Quote
Crossbow Posted September 1, 2006 Report Posted September 1, 2006 If your thumbwheels are X0-X7, you can use [bIN K2X0 D0] and you'll get the BCD number from those 8 inputs in a binary format in D0. The K2 means 2 nibbles (2 digits). Quote
Big Country Posted September 1, 2006 Author Report Posted September 1, 2006 That worked great sometimes its just those simple things that get you stumped. I appreciate all of your help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.