Write an assembly program called hw3_ex1, stored in file hw3_ex1.asm, that prompts the user to type a 5-character string. The program reads the first 5 characters of that string and prints two strings. The first string contains the 5 characters entered by the user, but in reverse order. The second string contains the 5 characters entered by the user, but whose ASCII code has been decremented by 32. Match the example shown below, where user input is shown in bold face:
% ./hw3_ex1You may assume that the user will always type exactly 5 characters followed by a carriage return (no need to deal with errors, etc.).
Enter a 5-character string: hguot
String #1: tough
String #2: HGUOT
Reading a character from the keyboard is done via the read_char macro (see page 17 of the textbook for a description). So you'll have to call this macro 5 times to get the 5 characters.
Remember that when you print a string it should be null-terminated. So, to store a 5-character string that you will print you need to store it in 6 bytes, with the last byte equal to 0.
Exercise #2: Overflow [20 pts]
For each of the following hex operation say whether the carry bit is set and whether the overflow bit is set. Also, for each operation, if the result were sign-extended into the EAX register, say what print_int would print? (Remember that this macro prints signed numbers in decimal representation).