用Java实现的编译器。把源代码编译成SPARC汇编程序
源代码在线查看: 00-empty.s
! SPARC assembly: ! Automatically generated by ASM.SPARCGenerator .section ".data" .GLOBALFIELD: .ARRAY_OUT_OF_BOUND: .asciz "testcases/codegen/00-empty.dcf:%d: runtime error: array out of bound; accessing: %d, array size: %d\n" .align 4 .DIVISION_ZERO: .asciz "testcases/codegen/00-empty.dcf:%d: runtime error: division to zero\n" .align 4 .CONTROL_FALLING_OFF: .asciz "testcases/codegen/00-empty.dcf:%s: runtime error: control falling off the end of the method: %s\n" .align 4 .section ".text" .align 4 .global main .globl main main: sethi %hi(.GLOBALFIELD), %g2 or %g2, %lo(.GLOBALFIELD), %g2 save %sp, -96, %sp !Return statement for method: ret restore !Datasection .MDNAME_main: .asciz "'main( )'" .align 8 .MDNAME_main_LINE_NO: .asciz "5" .align 8