assembly - Spim Crashing to Mips Reading from File -
I am trying to use a file mips assembly, but every time I run the code, spam crashes is.
I got
.data str: .asciiz "Welcome: code from many websites which all had the same code and it worked fine for them. < P> \ n "Fin: .asciiz" test.txt "buffer: .space 1024 .text .globl Main main: La $ a0, str li $ v0.4 syscall #open file $ li0, $ 13 file $ Open a0, open # load file name li $ a1, 0 # li $ a2 open to read, 0 simple moves $ s6, $ v0 # load file descriptor li $ v0, 14 # add from file $ a0, $ s6 , $ 0 # Add file descriptor La $ A1, buffer # address of buffer R $$ 2, 1024 # hardcod buffer length Sisal Li $ V0, 16 # Call to close the system file $ a0, add $ s6, file descriptor to close $ 0 # syscall: $ li $ v0,10 Syscall
Comments
Post a Comment