Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-23-2004, 11:44 AM   #1
Registered: Apr 2003
Location: Kuwait
Distribution: NetBSD x86; Slackware Linsux i686 (A billion kilometers away)
Posts: 101

Rep: Reputation: 15
MIPS assembly question

Just out of curiosity, if you were writing code to assemble with as rather than SPIM, (MIPS code) exactly what registers can you use? And which is read by 'syscall'? (And which is read by syscall for something like print)
Also, are the syscall numbers for read_int and such similar to that of SPIM?
I ask because as failes to assemble when I use $a0 or $v0.
Old 08-24-2004, 05:33 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,571

Rep: Reputation: 180Reputation: 180
Try registers $0, $1 and so on. It should work that way. It also looks that 'syscal' instruction exists in real mips, but printing anything is not as easy as when using the similator.
IMHO the easiest thing would be (if you have MIPS version of gcc, but if you have as...) to write a short C program with 'printf' and compile it this way
gcc -O2 -S prog.c
You'll get your program compiled to assembly.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MIPS question... kponenation Programming 10 10-04-2005 01:21 AM
Inline Assembly Question tjt Programming 3 08-08-2004 04:38 AM
C & Assembly question eantoranz Programming 3 04-23-2004 01:18 PM
Assembly Question! wwnn1 Programming 4 06-16-2002 01:18 AM
MIPS assembly fenriswolf Programming 0 10-17-2001 03:01 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration