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
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