Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:40:37+00:00 2026-06-05T12:40:37+00:00

there I’m currently trying to write a MIPS program that will sort the user

  • 0

there I’m currently trying to write a MIPS program that will sort the user inputted String and Bubble sort it. A being the in the front and Z last.

Right now I’m kind of confused on how I can compare each individual character in the string. So for example:

String: Stackoverflow
Compare S and T the first two letters. Since S is belongs in the front it stays and no swap happens.

How would I go about moving onto the next set of characters to compare so T and A would be the next set to compare.

I think I would use the lb (load byte) instruction but I’m not entirely sure of to use the offset correctly.

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:40:39+00:00Added an answer on June 5, 2026 at 12:40 pm

    Just as a reminder, in the loop, you must check whether the current pointer is > than the index (base pointer + length of the string – 1), or you can also check the value at index (current pointer + 1) equals to 0 (NUL) string terminating character or not.

    Make sure you keep a copy of the base pointer somewhere (in register or memory).

    In each loop, you will read the character currently pointed to by the current pointer by load byte at current pointer with offset 0, and read the next character by load byte at current pointer with offset 1. Then you can do the comparison and swapping. After that, you increase the current pointer by 1 (since a character in ASCII is 1 byte, you will increase the address by 1 byte only).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are some stdlib functions that throw errors on invalid input. For example: Prelude>
There is my code that I want to alert test once when mousemove ,
There is some contradiction in the api documentation: on one location: https://developer.foursquare.com/docs/responses/user on another
There are two ways that I know that you can fetch results in Rails
There are posts that touch on this question, but no one that I can
There will be 500+ threads concurrently uploading an unique object to a bucket all
There are many string matching algorithms can be used to find a pattern (string)
I've got a string that has curly quotes in it. I'd like to replace
There is a website called Gild.com that has different coding puzzles/challenges for users to
There is no doubt that MonoTouch is one of the great cross-compiler(s). Similarly, SenchaTouch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.