.globl _start .section .data # x: .word 42 # Use a label to store the retval in the file's mem address space .set retval, 88 # Use .set to create a symbol in the object/executable's symbol table .section .text # with the return value _start: # la t1, x # If we have the value stored in the .data section, we need to # use 'la' to retrieve the address and # lw a0, (t1) # 'lw' to load it into the register li a0, retval # We have retval defined in the file's symbol table (use nm or readelf) # to display the symbol table. li a7, 93 ecall