Question: Create an HLA function that loops through a single string argument and finds the smallest letter in it. This function should have the following signature:
Create an HLA function that loops through a single string argument and finds the smallest letter in it. This function should have the following signature: procedure getSmallest( stringData : dword ); @nodisplay; @noframe; This function should return into EAX the smallest letter found in the stringData parameter. By "smallest", I mean the ASCII code value which is the least. To receive full credit, your getSmallest( ) procedure must not allocate any storage.
Also, your function should replicate the following C code: int getSmallest( char * stringData ) {
int i = 0; int smallest = stringData[ 0 ]; while ( stringData[ i ] != NULL ) { int letter = stringData[ i ]; if (letter < smallest) {
smallest = letter;
}
i = i + 1;
} return( smallest );
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
