Question: How do I create this HACK asm //This asm checks whether two numbers a and b are complements; //that is, each bit active in a
How do I create this HACK asm //This asm checks whether two numbers a and b are complements; //that is, each bit active in a is inactive b, and vice-versa. //Other ways of saying this are: // (a & b) = 0 and (a | b) = 0b111..., where & is bitwise AND and | is bitwise OR // (a + b) = -1 // and any other technique you come up with is ok, as long as it functions properly. //The two numbers are given in RAM[0] and RAM[1] //and the result will be stored to RAM[2]. //The result should be 1 if a and b are complements, //and 0 if they are not. ///////////////////////////////////////////////////////////////////////////////
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
