SPIM: Cannot open file

1.5k views Asked by At

I used SPIM to simulate the following assembly code (MIPS).

main:
li $v0, 5
syscall

move $a0, $v0
addi $t0, $zero, 1
addi $a1, $zero, 0

Loop:
    add $a1, $a1, $t0
    addi $t0, $t0, 1
    bne $t0, $a0, Loop

move $a0, $a1
li $v0, 1
syscall

li $v0, 10
syscall

It was working all fine till I gave 1 as input which got into some infinite loop and lots of exceptions appeared. I had to kill the terminal to come out of this stuff. Now when I try to load any asm file in SPIM:

(spim) load "function.asm" Cannot open file: `function.asm'

What can be the possible reason for this behaviour? Any solution to the problem?

0

There are 0 answers