Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a simple assembly language program that reverses a bitpattern in memory i.

ID: 3609225 • Letter: W

Question

Write a simple assembly language program that reverses a bitpattern in memory i.e. "1234" becomes "4321". (This is not tobe confused with inverting the bits where the 0's become 1's andthe 1's become 0's. ) Assume that a bit pattern is given inlocation x3100 and that all the bits are to be reversed and thenplaced in location x3102. For example, if the bit pattern 1010 10010100 1011 is stored in location x3100, then the pattern to beplaced in x3102 should be, 1101 0010 1001 0101.
This is a lifesaver question. Thank you. Write a simple assembly language program that reverses a bitpattern in memory i.e. "1234" becomes "4321". (This is not tobe confused with inverting the bits where the 0's become 1's andthe 1's become 0's. ) Assume that a bit pattern is given inlocation x3100 and that all the bits are to be reversed and thenplaced in location x3102. For example, if the bit pattern 1010 10010100 1011 is stored in location x3100, then the pattern to beplaced in x3102 should be, 1101 0010 1001 0101.
This is a lifesaver question. Thank you.

Explanation / Answer

I hope it will help you. // Reverse the 32-bits in EAX, leaving the result in EBX: mov( 32, cl ); RvsLoop: shr( 1, eax ); // Move current bit in EAX to the carry flag. rcl( 1, ebx ); // Shift the bit back into EBX, backwards. dec( cl ); jnz RvsLoop ************** Complete help can be found on this link http://webster.cs.ucr.edu/AoA/Windows/HTML/BitManipulationa2.html

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote