Question
Write an assembly language program to declare two variables of type integer and initialize it to 2367 and 4792. Your code must determine in how
Write an assembly language program to declare two variables of type integer and initialize it to 2367 and 4792. Your code must determine in how many bit positions these two numbers differ. Write a procedure called displayBits to display an integer value in binary one bit at a time. Display both numbers in binary form using AND and shift operator to determine each bit and use Irvine library to display a character. The displayBits procedure, will print each bits of an integer lets say in the variable value. For the procedure displayBits, you must write a loop that repeats 32 times. Each time in the loop mask the value with the pattern 1 followed by 31 zeros after it. You can have 1 in EBX and shift is left 31 times. This is how you can get the mask value. Then each time AND the maskValue with the value you want to display. The result will be either 0 or 1 followed by zeros. If the result is zero, that means the bit you are analyzing is zero. By shifting the value to left, you can analyze the next bit in value. Value: 11011100110 maskBit 10000000000 result 10000000000
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