Complement on 14M2

cachomachine

Senior Member
I need help to make the complement (invert) of a 8 bit variable on a 14M2 chip
The INV command is only available on X and X2 chips
Any toughts?
 

oracacle

Senior Member
the only way I can think of would be on the bit level with if statements
if we pesume b0 (bits 0 - 7

Code:
      [color=Blue]if [/color][color=Purple]bit0 [/color][color=DarkCyan]= [/color][color=Navy]1 [/color][color=Blue]then
            [/color][color=Purple]bit0 [/color][color=DarkCyan]= [/color][color=Navy]0
      [/color][color=Blue]else
            [/color][color=Purple]b0 [/color][color=DarkCyan]= [/color][color=Navy]1
      [/color][color=Blue]end if[/color]
you would have to do that for all 8 bits in the byte that needs inverting, however there must be a simper faster way
 

oracacle

Senior Member
knew some one be able to do it

wrote this to test

Code:
[color=Black]main:
      [/color][color=Blue]let [/color][color=Purple]b0 [/color][color=DarkCyan]= [/color][color=Navy]%11000011
      [/color][color=Blue]let [/color][color=Purple]b1 [/color][color=DarkCyan]= [/color][color=Navy]255[/color][color=DarkCyan]-[/color][color=Purple]b0
      [/color][color=Blue]goto [/color][color=Black]main[/color]
b1 will show the inverted value to b0
 
Top