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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started