All of lore.kernel.org
 help / color / mirror / Atom feed
* Code error - why?
@ 2002-06-17  9:48 Balakrishnan Ananthanarayanan
  2002-06-17 16:01   ` Bradley D. LaRonde
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Balakrishnan Ananthanarayanan @ 2002-06-17  9:48 UTC (permalink / raw)
  To: linux-mips, linux-kernel, redhat-list

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?

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
@ 2002-06-17 16:01   ` Bradley D. LaRonde
  0 siblings, 0 replies; 7+ messages in thread
From: Bradley D. LaRonde @ 2002-06-17 16:01 UTC (permalink / raw)
  To: Balakrishnan Ananthanarayanan, linux-mips

Drop the $ on the registers?

Regards,
Brad

----- 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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
@ 2002-06-17 16:01   ` Bradley D. LaRonde
  0 siblings, 0 replies; 7+ messages in thread
From: Bradley D. LaRonde @ 2002-06-17 16:01 UTC (permalink / raw)
  To: Balakrishnan Ananthanarayanan, linux-mips

Drop the $ on the registers?

Regards,
Brad

----- 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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
  2002-06-17  9:48 Code error - why? Balakrishnan Ananthanarayanan
  2002-06-17 16:01   ` Bradley D. LaRonde
@ 2002-06-17 16:29 ` Justin Wojdacki
  2002-06-17 16:55 ` Thiemo Seufer
  2 siblings, 0 replies; 7+ messages in thread
From: Justin Wojdacki @ 2002-06-17 16:29 UTC (permalink / raw)
  To: Balakrishnan Ananthanarayanan; +Cc: linux-mips

Balakrishnan Ananthanarayanan wrote:
> 
> 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?
> 

$a0 and $v0 are what's probably giving you grief. Are you relying on
the assembler to know these symbols or are you including a file that
defines them. 

Just to be sure, try replacing $a0 with $4 and $v0 with $2 and see if
the code builds.

-- 
-------------------------------------------------
Justin Wojdacki        
justin.wojdacki@analog.com         (408) 350-5032
Communications Processors Group -- Analog Devices

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
  2002-06-17  9:48 Code error - why? Balakrishnan Ananthanarayanan
  2002-06-17 16:01   ` Bradley D. LaRonde
  2002-06-17 16:29 ` Justin Wojdacki
@ 2002-06-17 16:55 ` Thiemo Seufer
  2 siblings, 0 replies; 7+ messages in thread
From: Thiemo Seufer @ 2002-06-17 16:55 UTC (permalink / raw)
  To: linux-mips

Balakrishnan Ananthanarayanan wrote:
[snip]
>          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?

The register names are wrong. The software names, if defined in some
assembler header, are 'a0' and 'v0', while the assembler recognized
hardware names are '$4' and '$2'.


Thiemo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
  2002-06-17 16:01   ` Bradley D. LaRonde
  (?)
@ 2002-06-18 16:14   ` Justin Carlson
  2002-06-19 16:18     ` Maciej W. Rozycki
  -1 siblings, 1 reply; 7+ messages in thread
From: Justin Carlson @ 2002-06-18 16:14 UTC (permalink / raw)
  To: Bradley D. LaRonde; +Cc: Balakrishnan Ananthanarayanan, linux-mips

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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Code error - why?
  2002-06-18 16:14   ` Justin Carlson
@ 2002-06-19 16:18     ` Maciej W. Rozycki
  0 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2002-06-19 16:18 UTC (permalink / raw)
  To: Justin Carlson
  Cc: Bradley D. LaRonde, Balakrishnan Ananthanarayanan, linux-mips

On 18 Jun 2002, Justin Carlson wrote:

> 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

 Well, the usual choice is to put "#include <asm/regdef.h>" instead of
copying definitions.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-06-19 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-17  9:48 Code error - why? Balakrishnan Ananthanarayanan
2002-06-17 16:01 ` Bradley D. LaRonde
2002-06-17 16:01   ` Bradley D. LaRonde
2002-06-18 16:14   ` Justin Carlson
2002-06-19 16:18     ` Maciej W. Rozycki
2002-06-17 16:29 ` Justin Wojdacki
2002-06-17 16:55 ` Thiemo Seufer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.