# struct s0 { # int x; # int y; # }; # struct s2 { # char c1; # char c2; # int x; # }; main: li $t0, 10 #my_struct.x = 10; sw $t0, my_struct+0 li $t0, 3 #my_struct.y = 3; sw $t0, my_struct+4 li $v0, 11 lb $a0, my_other_struct+0 #putchar(my_other_struct.c1); syscall li $v0, 11 #putchar(my_other_struct.c2); lb $a0, my_other_struct+1 syscall li $v0, 1 #printf("%d", my_other_struct.x); lw $a0, my_other_struct+4 syscall li $v0, 0 jr $ra .data my_struct: .space 8 #struct s0 my_struct; // 8 bytes my_other_struct: #struct s2 my_other_struct = {'A', 'Z', 99}; .byte 'A' .byte 'Z' .word 99