Mips count characters in string

Click For Summary
SUMMARY

This discussion focuses on counting characters in a string using MIPS assembly language and displaying the count in hexadecimal format. Key steps include iterating through each character in the string, identifying the null terminator that marks the end of the string, and converting the integer count to hexadecimal representation. Participants emphasize the importance of understanding MIPS string manipulation and integer storage in memory for successful implementation.

PREREQUISITES
  • MIPS assembly language programming
  • Understanding of string manipulation in MIPS
  • Knowledge of null terminators in strings
  • Familiarity with integer representation in memory
NEXT STEPS
  • Research MIPS string iteration techniques
  • Learn how to convert integers to hexadecimal in MIPS
  • Explore MIPS examples for character counting
  • Study MIPS memory management and data types
USEFUL FOR

Students learning MIPS assembly language, programmers developing low-level applications, and anyone interested in string processing and hexadecimal conversion in MIPS.

keo
Messages
1
Reaction score
0
Summary:: Count characterers in a string and display it in hexadecimal

[New user has been reminded to show their work on schoolwork problems]

Hi, how can I do this in MIPS?
Given a string of characters, the program has to count the number of characters in the string, and display it in hexadecimal.
Thank you!
 
Last edited by a moderator:
Physics news on Phys.org
1) Do you know how to count In MIPS?

2) Do you know how to look at each character in a string?

3) Do you know what character marks the end of a string?

4) Do you know about integers and how they are stored in memory?

5) If you look at a stored integer 4-bits at a time you can map it to a hex character.

To help here's a bunch of MIPS programming examples and there are many sites online with further examples. From them, you might methods of counting, accessing string characters, and displaying hex values.

Sadly, though we can't help you write your program, we can critique if you give a version and tell us why it's not working.

https://courses.cs.washington.edu/courses/cse378/03wi/lectures/mips-asm-examples.html
 
Last edited:

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 24 ·
Replies
24
Views
4K
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K