Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: PLCwannabe on August 13, 2021, 06:46:30 PM

Title: How to invert all bits within a word.
Post by: PLCwannabe on August 13, 2021, 06:46:30 PM
What is the best, quickest way to invert all bits within a u-word?
   I want to write commands (start/stop/auto/off) to a Genset, which requires a  code number to be written to one register, and the same write action has to write the ones-complement of that code to a second register.   Attached are a few rungs of code that accomplish this, but I'm sure there is such an instruction somewhere.
Title: Re: How to invert all bits within a word.
Post by: RBPLC on August 13, 2021, 09:09:14 PM
MATH V102=~V101. Bit-wise invert, Help Topic DMD0537.
Title: Re: How to invert all bits within a word.
Post by: PLCwannabe on August 14, 2021, 10:18:39 AM
  Great, thanks.