LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 11:44 AM   #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, 05:33 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 PM.

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
Open Source Consulting | Domain Registration