linux-mips
[Top] [All Lists]

Re: Code error - why?

To: "Bradley D. LaRonde" <brad@ltc.com>
Subject: Re: Code error - why?
From: Justin Carlson <justin@cs.cmu.edu>
Date: 18 Jun 2002 09:14:09 -0700
Cc: Balakrishnan Ananthanarayanan <balakris_ananth@email.com>, linux-mips@oss.sgi.com
In-reply-to: <00bd01c21618$4e714ef0$4c00a8c0@prefect>
References: <20020617094851.30730.qmail@email.com> <00bd01c21618$4e714ef0$4c00a8c0@prefect>
Sender: owner-linux-mips@oss.sgi.com
After preprocessing, the assembler needs to see $<number> as 
register specifiers, so typically your choices are to do either:

#define a0 $4  // See include/asm-mips/regdef.h for these
#define v0 $2

...

        la a0, quest
        li v0, 4



Or to just use the register numbers, e.g.

        la $4, quest
        li $2, 4


-Justin


> ----- Original Message -----
> From: "Balakrishnan Ananthanarayanan" <balakris_ananth@email.com>
> To: <linux-mips@oss.sgi.com>; <linux-kernel@vger.kernel.org>;
> <redhat-list@redhat.com>
> Sent: Monday, June 17, 2002 5:48 AM
> Subject: Code error - why?
> 
> 
> > I wrote a SAMPLE CODE - Hello.S to work for a cross-assembler
> mips-linux-as - but this is giving me an error message:
> >    ".data
> >          quest: .asciiz "Hello World!"
> >     .text
> >     _start:
> >          la $a0, quest
> >          li $v0, 4
> >          syscall   "
> >
> > The error messages are:
> >   " Hello.S line 5: illegal operands 'la'
> >     Hello.S line 6: illegal operands 'li'"
> >
> > Can anyone help? What is wrong?

<Prev in Thread] Current Thread [Next in Thread>