Since WORD data types are logic patterns, rather than values, you then need to start thinking about using logical operators rather than arithmetic operators such as 'compare'.
Fortunately there are only a few logical operators: AND, OR, XOR.
Let's consider the result of these on two WORDs with identical and different bit patterns -
AND Result if identical: Output is identical to both inputs
AND Result if different: Output has unpredictable pattern
OR Result if identical: Output is identical to both inputs
OR Result if different: Output has unpredictable pattern
XOR Result if identical: Output is all '0'
XOR Result if different: Output has unpredictable pattern
I don't know what you want to do with the result of this operation. Even in the only case where you can predict the output I'm not sure of the most appropriate method to detect whether this condition exists or not?
Regards
Ken
(PS : Can someone check and confirm or deny my logic? The more I re-read it, the more doubts I have about it!)