开发者

Need help with MIPS programming [duplicate]

This question al开发者_如何学Cready has answers here: Closed 12 years ago.

Possible Duplicate:

Need help with MIPS program

Hi guys, I'm having the hardest time programming in MIPS assembly language. I have to write a program that reads a string (from a keyboard), stores it in the memory, and computes and prints the frequency of each character; and then it reverses the string and prints the reversed string.

I have no idea how to start writing this. Can anyone help me?

Any help is greatly appreciated,

Thanks.


Start from this free Appendix that covers many topics of what you need to do (mainly for Mips over PCSPIM, but it should be ok since your question seems homework). Link here (PDF).


MIPS just refers to a certain type of processor - by itself it can't do anything useful.

Attached to some memory, it can run machine-code programs stored in that memory, and change the memory contents, but still has no way of interacting with the outside world.

In order for it to accept input (the string) and generate output (the frequencies and reversed string) it must be connected to a device that allows it to interact with other computers or people, such as graphics or keyboard controllers or a network interface.

You mention in a comment that you're using PCspim - this emulates a certain type of MIPS processor. It also simulates a "memory-mapped console" which lets you read characters from the keyboard and write to the screen by accessing memory between 0xffff0000 and 0xffff0010.

My approach would be to find an existing program (Googling spim examples brings up a few), get it running in PCspim to ensure the simulator is installed and working correctly, figure out how it works, then try to adapt it (with reference to the spim docs) to do what you want. If you encounter a problem you can't solve then post a new question with specific details of where you're stuck and what you've tried.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜