linux-mips
[Top] [All Lists]

MIPS/Linux assembly issue

To: linux-mips@linux-mips.org
Subject: MIPS/Linux assembly issue
From: adnan iqbal <adnan.iqbal@seecs.edu.pk>
Date: Fri, 21 May 2010 16:46:36 +0500
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi all,

I am trying to compile/link/execute following very simple program in debian/MIPS (Tried on Qemu and Octeon). I am getting errors while executing the program. gdb also shows a strange behavior showing program entrypoint somehere in data segement. Any help getting this sorted out shall be appreciated.

Regards
Adnan

Commands used to compile/link
----------------------------------------------------
$ as hello.s -o hello.o
$ld hello.o -o hello
$ ./hello


The code
---------------
      .data
str:
        .asciiz "hello world\n"
        .text
        .globl __start

__start:
        jal f2
        la $4,str
        li $2,4
        syscall

        ## terminate program via _exit () system call
        li $2, 10
        syscall
f2:
        add $8,$8,$0
        jr $31
    
<Prev in Thread] Current Thread [Next in Thread>