Question: Write code for an assembly language function named rot_left_right which does a rotating left or right shift of a given integer (provided in R5) by

Write code for an assembly language function named rot_left_right which does a rotating left or right shift of a given integer (provided in R5) by an amount given in R10, bits 4:0. Bit 5 of R10 should be 1 to rotate left, or 0 to rotate right. The result should be returned in R11. You are not allowed to use the rotation assembly language instructions: neither ROR nor RRX. For example, if you call your function with R5=0x12345678 and the rotate amount R10=4 in bits 4:0 and the value 1 in R10 bit 5, the result should be rotated left by 4 bits: R11=0x23456781. If the user provides a rotate value of 0, then the function should return the original integer unchanged. Call your function from your mainline code, providing various parameters and checking the result for correctness.

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!