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