Representing and Manipulating Information
1. Write code for an assembly language function named rot_left which rotates a given integer (provided in R6 by a value given in R12. The result should be returned in R4.
Your function should assume that the amount to rotate is between 0 and 31 inclusive. You are not allowed to use the rotation assembly language instructions:
neither ROR nor RRX.
Call your function from your mainline code, providing various parameters and checking the result for correctness.
2. Write a function in assembly language named encrypt which takes a pointer to a buffer containing some cleartext, and modifies the buffer to contain the encrypted version of that text.
The encryption scheme is to add a (wrap-around) displacement n to each alphabetic char. For example given the clear text
AaBbCcDdEeFfGgHhIiJjKkL1MmNnOoPpQqRrSsTtUuVvWXxYyZz
0123456789
Hello, my boots are layered like an onion.
!@#$%"&*()_-+={}[]\|
<>,.?/~;:"
and assuming for example n = 13, the result should be
NnOoPpQqRrSsTtUuVvi&XxYyZzAaBbCcDdEeFfGgHhIiJjKkL1Mm
0123456789
Uryyb, zl obbgf ner ynlrerq yvxr na bavba.
!@#$%"&*()_-+={}[]\|
<>,.?/-~ ;:"