listdoit test1_ss >& test1_ss_listdoit.txt The input code: %%ss writeln ("hello world"); -------------------------------------- Running SIMPLE with command line -i (AST) -s (SymbolTable dump) -v (var addrs) Warning (GetVars) No entries in the symbol table! in simple.c After : PushString Semstack is: StrconstEntryEntry (hello world) <+ SemTop StLstEntry After : CreateActParam2 Semstack is: ParmEntry <+ SemTop StLstEntry After : Call Semstack is: StmtEntry <+ SemTop StLstEntry After : MergeStmts Semstack is: StLstEntry <+ SemTop Warning: symbol table is empty (in done) Warning: var list is empty (in done) After : Done Semstack is: EMPTY Symbol table dump: SymRoot is NULL => symbol table is empty Intermediate Representation - the Abstract Syntax Tree Statements Writeln parameters hello world From codegen.c - DisplayRegs() marks used registers Register: 0 1 2 3 4 5 6 7 8 9 - - - - - - - - - - Used = x: Warning (codegen): no entries found in variable list Variable dump from GenStorage COMPILATION COMPLETE out simple.c ------------------------------------- The listing file produced by simple %%ss writeln (hello world); ------------------------------------- The assembler file produced by simple # Register Usage: # $s0 for global variables # .text .globl main main: la $s0, GVARS # # Start Code # # Generate Writeln statement la $a0, S1 li $v0, 4 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" .data S1: .asciiz "hello world" # # Reserve space for global variables .word 0 GVARS: # space for Global Variables .data Temp_Wr: .word 0 #just for alignment of write(exprtree) ------------------------------------- execute the code in spim: SPIM Version 6.2 of January 11, 1999 Copyright 1990-1998 by James R. Larus (larus@cs.wisc.edu). All Rights Reserved. See the file README for a full copyright notice. Loaded: /opt/spim/bin/trap.handler hello world