Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an HLA function that determines if a passed character parameter is a lowercase letter. This function should have the following signature: procedure isLower (

Create an HLA function that determines if a passed character parameter is a lowercase letter. This function should have the following signature:
procedure isLower( c : byte ); @nodisplay; @noframe;
This function should return into EAX an int32 value which is either true or false, 1 or 0. To receive full credit, your isLower() function must not allocate any storage.
Your function should replicate the following C code:
bool isLower( char c )
{
bool result = false;
if( c >=a && c <=z)
{
result = true;
}
return( result );
}
IN ORDER TO RECEIVE FULL CREDIT, YOU MUST USE THE TEMPLATE SOLUTION SHOWN BELOW. Of course, you will need to add code to the function to implement the desired algorithm explained above. In addition, you will need to push the parameters to the function.
// Character Parameter Template Solution For CS 17 Final
// CS 17 Students must use this template as the basis for their solution.
// Please look at the two TODO: notes below
program CharProgram;
#include( "stdlib.hhf");
static
cMyCharacter : byte :=0;
answer : int32;
// TODO: CS 17 Students add code below to implement this function
// Several hints are supplied
procedure isLower( c: byte ); @nodisplay; @noframe;
static
dReturnAddress : dword;
begin isLower;
// TODO: CS 17 Students will need to preserve registers
pop( dReturnAddress );
// TODO: CS 17 Students need to get c off the stack
// push back the return address
push( dReturnAddress );
// preserve registers
// begin function implementation
// leave the answer in EAX
// restore the registers used
ret();
end isLower;
begin CharProgram;
stdout.put( "Please enter a character process", nl );
stdin.flushInput();
stdin.getc(); // stores result in AL
mov( AL, cMyCharacter );
stdout.put("----> here is the character you entered: ");
stdout.putc( cMyCharacter );
stdout.newln();
// initialize EAX before calling the function.
mov(0, EAX );
// TODO: CS 17 Students need to pass a character parameter to the function
call isLower;
mov( EAX, answer );
// show the results
stdout.put( "after isLower --- result=");
stdout.put( answer );
stdout.newln();
end CharProgram;

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Identify the various bases for departmentalization.

Answered: 1 week ago