0

For example if the file I am trying to read has:

sum: .word 0

How would I read the value for sum and store it into another files variable?

MDRIV3
  • 39
  • 1
  • 6

1 Answers1

0

There's nothing special about accessing symbols defined in another source file when using QtSpim. Just load all the source files, and then press the Run button.

An example:

foo.s

.globl main
.text

main:
    # Print sum
    lw $a0, sum
    li $v0,1
    syscall

    # Exit
    li $v0,10
    syscall

bar.s

.data
sum: .word 123
Michael
  • 57,169
  • 9
  • 80
  • 125