Writing a caesar cipher in ARM assembly. INSTRUCTIONS: Step 1: The first thing you...

60.1K

Verified Solution

Question

Programming

Writing a caesar cipher in ARM assembly.

INSTRUCTIONS:

Step 1:  The first thing you should do is modify the case conversion program String.s (provided)  Instead of subtracting 32 from all numbers you want to add a constant number which we will call the key.  Assume that all input will be lowercase.   So it'll look like this,    k = 2;    letter = 'a';    newletter = k+letter;  Above is pseudocode and ABOVE NOT ASSEMBLY CODE DO NOT COPY.  Use bl puts to show that everything is working correctly.  You should hard code the plaintext in the assembly file.Step 2:  If the key + letter is bigger is 'z' then you have to subtract 26.  If the key + letter is less than 'a' then you have to add 26.

STRING.S

.text.global mainmain:  ldr r4,=stringget_another_byte:  ldrb r5,[r4]  cmp r5,#'a'#  blt keep_going#  cmp r5,#'z'#  bgt keep_going  subeq r5,#32  strbge r5,[r4]keep_going:  add r4,#1  cmp r5,#0  bne get_another_byte  ldr r0,=temp  str lr,[r0]  ldr r0,=string  bl puts  ldr r0,=temp  ldr lr,[r0]  bx lr.datastring:.asciz \"This is a string |\"temp:  .word 0

Answer & Explanation Solved by verified expert
3.7 Ratings (392 Votes)
Solution Below is the code for caesar cipher in ARM assembly PRESERVE8 AREA vectors CODE READONLY EXPORT Vectors Vectors DCD 0x20008000 stack pointer value when stack is empty DCD ResetHandler reset vector ALIGN Data area AREA MyData DATA READWRITE EXPORT Ciphertext Deciphertext Ciphertext SPACE 100 space to save cipher text Deciphertext SPACE 100 space to save deciphered text ALIGN AREA MainProgram CODE READONLY Key    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students