Question: Question #2 15 marks: Write an ARM assembly language program to detect the even parity of the value stored in register ro and store the
Question #2 15 marks: Write an ARM assembly language program to detect the even parity of the value stored in register ro and store the result of detection in the least significant bit of register rl, i.e. if r0 contains an even number of ones, r1 = 0x00000001 else rl = 0x00000000 Do this using the following algorithm: Initialize rl to 0x00000001 (assume initially that we have zero number of ones - which is even) and go through the bits of ro one by one. If this bit is 1, you complement the least significant bit of rl. Therefore, you can do this by looping for 32 iterations. In each iteration, you rotate ro by one position and use the carry flag value to decide the complementing of the least significant bit of rl
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
