rohan% simple -a texp0 in simple.c *** Sending Assembler Code to Screen *** From codegen.c - DisplayRegs() marks used registers Register: 0 1 2 3 4 5 6 7 8 9 - - - - - - - - - - Used = x: # Register Usage: # $s0 for global variables # .text .globl main main: la $s0, GVARS # # Start Code # # Generate Assignment Statement li $t0,2 sw $t0,0($s0) # # Generate Write statement li $v0, 1 lw $a0,0($s0) syscall # # Generate Assignment Statement lw $t0,0($s0) add $t0,$t0,9 mul $t0,$t0,4 lw $t1,0($s0) add $t0,$t0,$t1 sw $t0,4($s0) # # Generate Writeln statement li $v0, 1 lw $a0,4($s0) syscall la $a0, S0 li $v0, 4 syscall # # Halt execution li $v0 10 syscall # # Finish up by writing out constants .word 0 CONST: #Constant storage area .data S0: .asciiz "\n" # # Reserve space for global variables .word 0 GVARS: # space for Global Variables .data _x: .word 0 # Offset at 0 .data _y: .word 0 # Offset at 4 .data Temp_Wr: .word 0 #just for alignment of write(exprtree) COMPILATION COMPLETE