Mips count characters in string

AI Thread Summary
The discussion focuses on how to count characters in a string using MIPS assembly language and display the count in hexadecimal format. Participants emphasize the importance of understanding string termination, character access, and integer storage in memory. They encourage the user to explore MIPS programming examples available online for guidance. While direct assistance in writing the program is not provided, feedback on user-submitted code is welcomed. Overall, the thread serves as a resource for learning MIPS string manipulation and hexadecimal representation.
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
Views
2K
Replies
12
Views
2K
Replies
2
Views
2K
Replies
7
Views
3K
Replies
24
Views
3K
Replies
2
Views
3K
Back
Top