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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!