Question: 1. Write an ARMv7 assembly program that reads ASCII characters from the user (i.e., from stdin), pushing each individually onto the stack. Eventually they will

 1. Write an ARMv7 assembly program that reads ASCII characters fromthe user (i.e., from stdin), pushing each individually onto the stack. Eventually

1. Write an ARMv7 assembly program that reads ASCII characters from the user (i.e., from stdin), pushing each individually onto the stack. Eventually they will be printed to stdout (a) Each character is read individually from the user; this means you will need to store it in memory before pushing onto the stack and before reading another character. The way you will get a character from the user is to read from stdin like we have in earlier assignments. (b) After pushing every fourth character onto the stack, pop the last two characters from the stack, printing them as you pop them (this means in the reverse order in which they were added to the stack) (c) You will continue reading characters until you encounter the letter q'. This is the only ASCII character that will not be pushed onto the stack. When the user types q', you will pop and print the remaining characters on the stack in the order in which they are popped. (d) The characters read will have an ASCII value in the range 331o to 12610, inclusive. You do not have to check for this, I'm simply stating that you will not save characters like spaces or newlines on the stack. (e) After printing a sequence of characters that were popped from the stack, print a single newline (f) Note that for the way we know to write to stdout, the character that is popped from the stack will need to be stored in memory before writing to stdout (g) The name of this program will be hu09.s, all in lowercase. (h) Don't hard-code to this particular data, but here is a sample run: $ ./a.out dc 1. Write an ARMv7 assembly program that reads ASCII characters from the user (i.e., from stdin), pushing each individually onto the stack. Eventually they will be printed to stdout (a) Each character is read individually from the user; this means you will need to store it in memory before pushing onto the stack and before reading another character. The way you will get a character from the user is to read from stdin like we have in earlier assignments. (b) After pushing every fourth character onto the stack, pop the last two characters from the stack, printing them as you pop them (this means in the reverse order in which they were added to the stack) (c) You will continue reading characters until you encounter the letter q'. This is the only ASCII character that will not be pushed onto the stack. When the user types q', you will pop and print the remaining characters on the stack in the order in which they are popped. (d) The characters read will have an ASCII value in the range 331o to 12610, inclusive. You do not have to check for this, I'm simply stating that you will not save characters like spaces or newlines on the stack. (e) After printing a sequence of characters that were popped from the stack, print a single newline (f) Note that for the way we know to write to stdout, the character that is popped from the stack will need to be stored in memory before writing to stdout (g) The name of this program will be hu09.s, all in lowercase. (h) Don't hard-code to this particular data, but here is a sample run: $ ./a.out dc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!