Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions