Question: Objective Write an ARM program that takes a string as input and outputs the number of vowels in the string. Here is pseudocode for the

Objective
Write an ARM program that takes a string as input and outputs the number of vowels in the string.
Here is pseudocode for the solution:
Input: string
Output: print out of integer number of vowels in string
Pseudocode:
Print greeting and ask for string
use printf, format string is argument to printf, place in x0
Set a saved register (x19-x27) to zero to be used as a counter
Scanf to read input
format string is first argument, place in x0
address in memory where string will be put is second argument
Load the input char from memory into a register -- Idrb
Check if the char is a null or newline chararacter, if it is, go to step 8
Otherwise check if the char is a vowel (i.e. compare the char with the ascii values of A,E,I,O,U,a,e,i,o,u
If it is a value, increment the counter register
Go to step 4
Use printf to print the counter's value
x0 contains format string, x1 contains a value to replace the format specifier with
Run exit sequence
Compiling and Running Your Code
Compiling:
gcc -o pa1 pa1.s -g
Running:
./pa1
 Objective Write an ARM program that takes a string as input

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!