Results 1 to 1 of 1

Thread: spim simulator on ubuntu

  1. #1
    Join Date
    Feb 2008
    Beans
    7

    spim simulator on ubuntu

    Hi, i have installed spim but i doesn't load the asm file,
    This is the file:
    I use this command to load
    Code:
    load "add2.asm"
    or
    Code:
    load "home/dir/add2.asm"
    , but nothing happens.
    PHP Code:
    # add2.asm
    # somma 2 numeri dati in input

    # registri usati
    #    $t0 - usato per contenere il primo numero
    #    $t1 - usato per contenere il secondo numero
    #    $t2 - usato per contenere la somma di $t0 e $t1
    #    $v0 - syscall e valore di ritorno
    #    $a0 - syscall

    main:
        
    ## ottieni il primo numero 
        
    li     $v05     # chiama una syscall
        
    syscall     # crea la syscall
        
    move     $t0$v0     # sposta il numero letto in $t0
        
        ## ottieni il secondo numero
        
    li     $v05     # chiama una syscall
        
    syscall     # crea la syscall
        
    move     $t1$v0     # sposta il numero letto in $t0
        
        
    add     $t2$t0$t1 # effettua la somma

        ## Stampa $t2
        
    move     $a0$t2     # sposta il numero per stamparlo in $a0
        
    li     $v01    # chiama la syscall per stampare $v0
        
    syscall

        li     $v0
    10    # syscall codice 10 per uscire
        
    syscall     # crea la syscall

    # end of add2.asm. 
    It works, i forgot the command run!
    Last edited by blob84; October 12th, 2010 at 01:27 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •