Answered step by step
Verified Expert Solution
Link Copied!

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
# (out1, out2, or out3).
#Hint: This will require loops/branching/jumps.
.text
.data
#These are the two strings to compare. You should test the program with other
#string values than just these.
str1: .asciiz "apply"
str2: .asciiz "apple"
#The three possible outputs
out1: .asciiz "The first string precedes the second string"
out2: .asciiz "The second string precedes the first string"
out3: .asciiz "The strings are equal"

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

Step: 3

blur-text-image

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions