You are to design, write, test, and debug a MARIE assembly language program that inputs asequence of characters from the set A-Z (capital letters only), stores each character inmemory after it is transformed by the trivial ROT13 cipher, and then, after character inputcompletes, outputs the transformed characters.A template source code file (Project-2_Start.mas) is provided with this assignment. Edit thisfile to create a program that meets the program specifications. Note that the templateincludes instructions to initialize some working values that your program can use. Thetemplate also defines memory locations. You may add data memory locations. The programcan be designed without additional data locations, but it may be necessary to do so for yourdesign.
a)The first instruction of the program must be placed at location (address) 0x100 (100hexadecimal) in MARIE’s memory. This is accomplished by following the programtemplate that is provided.b) The constant data values (One, ChA, ChZ, ChPer, Val13, Start) should not bechanged by the program. The program can load from these memory locations, butshould not store to them.c) Transformed input characters must be stored in successive memory locations beginningat location 0x200 (200 hexadecimal) as indicated in the program template. Theprogram should store all transformed input characters before any characters areoutput.d) The program should always initialize the values for Ptr in the working data memoryand not rely on the values for these locations that are defined in the assembly sourcefile. This initialization is done by the provided template file.e) The program should work for any inputs ‘A’ through ‘Z’ and ‘.’ (a period terminatesinput). In the interest of keeping the program simple, the program does not need tovalidate inputs.f) When transformed characters are stored and when transformed characters are output,the program must use a loop and indirect addressing to access the values in the arrayof words. Note that variable Ptr is initialized in the template code and should beused in the loop. You may also define a Count variable to count the number ofcharacters, but there are also correct designs that do not require a Count variable.g) The program should operate as follows.Input Phase:
1.A character (A-Z or ‘.’) is input. MarieSim allows the user to input a singlecharacter that is read into the accumulator (AC) with an Input instruction.2. If character ‘.’ (period) is input, then the input phase ends and the outputphase begins (step 5 below). (The period may be stored in memory to mark theend of the characters or the characters can be counted to determine how manytransformed characters to output during the output phase.)3. The character that is input is transformed using the trivial ROT13 cipher (seeSection 5.1).4. The transformed character is stored in the next location in the block ofmemory beginning at location Start. (Variable Ptr must be updated andindirect memory addressing must be used.)Output Phase:5. All transformed characters are output, beginning with the first character thatwas transformed. The ‘.’ character is not to be output. (This will require aloop using variable Ptr and indirect addressing. Note that the number ofcharacters to output will vary and the program must know when to stop theoutput by relying on a ‘.’ or other special character in memory, counting thenumber of input characters during the input phase, or some other method.)6. After all characters are output, the program halts by executing the HALTinstruction.
Summary:Input phase– Input a character (‘A’-‘Z’ or ‘.’ only)– Apply the Rotate-13 (ROT13) transformationto the character if ‘A’-‘Z’– Store the transformed character in memory– Repeat until the input is a period (‘.’)• Output phase– Output the stored characters (but not the ‘.’)– The program halts (instruction “Halt”)