MARIE assembly language program
Program Operation
• Input phase
–Input a character (‘A’-‘Z’ or ‘.’ only)
–Apply the Rotate-13 (ROT13) transformation to 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”)
Program design
-initialize
-Input, transform, and store in memory
• Input character
• Call Rot13 to transform
• Store in memory
• Check for exit condition
-Read from memory and output
• Read character from memory
• Output character
• Check for exit condition
-Halt
Additional Requirements (1)
a) The first instruction of the program must be placed at location (address) 0x100 (100 hexadecimal) in
MARIE’s memory.
b) Constant data values should not be changed by the program.
c) Transformed input characters must be stored in successive memory locations beginning at location
0x200 (200 hexadecimal). The program should store all transformed input characters before any
characters are output.
Additional Requirements (2)
d) The program should always initialize the values for Ptr in the working data memory and not rely on
the values for these locations that are defined in the assembly source file.
e) The program should work for any inputs ‘A’ through ‘Z’ and ‘.’ (a period terminates input). The
program does not need to validate 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 array of words. You may define a
Count variable to count the number of characters, but there are also correct designs that do not require
a Count variable.
Two Test Cases
• Test 1: Input the eight-character sequence “VIRGINIA” followed by a ‘.’ to terminate the input. The
ROT13 value of each character (“IVETVAVN”) should be displayed after the ‘.’ character is input.
• Test 2: Reload the program in MarieSim, without reassembling, input the fourcharacter sequence
“GRPU” followed by a ‘.’ to terminate the input.