Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#Only use instructions that have been demonstrated in the lecture slides #or in the sample code provided. #This program compares two ( lowercase ) strings.
#Only use instructions that have been demonstrated in the lecture slides
#or in the sample code provided.
#This program compares two lowercase strings. It prints if the first string
alphabetically
#comes before the second string, if the second string comes before the first
string, or if
#the strings are equal.
#The program will do the following:
# Load the starting addresses of two strings from memory into registers
# Process the data of both strings by comparing each character.
# Once a determination is made, print out one of the three possible outputs
# out out or out
#Hint: This will require loopsbranchingjumps
text
data
#These are the two strings to compare. You should test the program with other
#string values than just these.
str: asciiz "apply"
str: asciiz "apple"
#The three possible outputs
out: asciiz "The first string precedes the second string"
out: asciiz "The second string precedes the first string"
out: asciiz "The strings are equal"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started