0

I have some assembly code which is giving me the error:

Errors detetected on pass 2

It highlights the halt command at the end in red. If I press "ok", the program opens but when I try to run it, I think it behaves differently from what I expected (more cycles).

Code:

.data
.text
main:
ld $s2, 0($s1)
ld $s1, 40($s6)
dsub $s6, $s1, $s2
dadd $s6, $s2, $s2
or $s3, $s6, $zero
sd $s6, 50($s1)
halt 
moopet
  • 6,014
  • 1
  • 29
  • 36
J. VR
  • 23
  • 5
  • `halt` is not a MIPS instruction. – markgz Mar 08 '17 at 21:47
  • and how can i end the programme? – J. VR Mar 08 '17 at 22:37
  • It's ASM, you can just let it fall off the bottom and it will automatically end – Peter G Mar 08 '17 at 22:45
  • oh ok thank you ! :D if u want write it as a post down to check it :) – J. VR Mar 08 '17 at 22:52
  • 2
    _"you can just let it fall off the bottom and it will automatically end"_ That's not a particularly good idea. The program should explicitly terminate or return to its caller. I believe WinMIPS64 supports using system call 10 as `sys_exit` just like SPIM/MARS. – Michael Mar 09 '17 at 06:50

0 Answers0