LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 08-23-2004, 12:44 PM   #1
Gnute
Member
 
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.
Thanks.
 
Old 08-24-2004, 06:33 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,540

Rep: Reputation: 149Reputation: 149
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.
 
  


Reply


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 02:21 AM
Inline Assembly Question tjt Programming 3 08-08-2004 05:38 AM
C & Assembly question eantoranz Programming 3 04-23-2004 02:18 PM
Assembly Question! wwnn1 Programming 4 06-16-2002 02:18 AM
MIPS assembly fenriswolf Programming 0 10-17-2001 04:01 PM


All times are GMT -5. The time now is 10:37 AM.

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