.file 1 "uart_echo_test.c"
|
.file 1 "uart_echo_test.c"
|
|
|
# -G value = 8, Cpu = 3000, ISA = 1
|
# -G value = 8, Cpu = 3000, ISA = 1
|
# GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release) (sde) [AL 1.1, MM 40] Algorithmics SDE-MIPS v4.0.5 compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
|
# GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release) (sde) [AL 1.1, MM 40] Algorithmics SDE-MIPS v4.0.5 compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
|
# options passed: -O2 -O -Wall
|
# options passed: -O2 -O -Wall
|
# options enabled: -fdefer-pop -fomit-frame-pointer -fthread-jumps
|
# options enabled: -fdefer-pop -fomit-frame-pointer -fthread-jumps
|
# -fpeephole -finline -fkeep-static-consts -fpcc-struct-return
|
# -fpeephole -finline -fkeep-static-consts -fpcc-struct-return
|
# -fdelayed-branch -fcommon -fverbose-asm -fgnu-linker -falias-check
|
# -fdelayed-branch -fcommon -fverbose-asm -fgnu-linker -falias-check
|
# -fargument-alias -msplit-addresses -mgas -mrnames -mgpOPT -mgpopt
|
# -fargument-alias -msplit-addresses -mgas -mrnames -mgpOPT -mgpopt
|
# -membedded-data -meb -mmad -marg32 -mdebugh -mdebugi -mmadd -mno-gpconst
|
# -membedded-data -meb -mmad -marg32 -mdebugh -mdebugi -mmadd -mno-gpconst
|
# -mcpu=3000
|
# -mcpu=3000
|
|
|
gcc2_compiled.:
|
gcc2_compiled.:
|
.globl int_flag
|
.globl int_flag
|
.sdata
|
.sdata
|
.align 0
|
.align 0
|
.align 2
|
.align 2
|
int_flag:
|
int_flag:
|
.size int_flag,4
|
.size int_flag,4
|
.word 0
|
.word 0
|
.rdata
|
.rdata
|
.align 0
|
.align 0
|
.align 2
|
.align 2
|
.LC0:
|
.LC0:
|
.ascii "PError!\n\000"
|
.ascii "PError!\n\000"
|
.align 2
|
.align 2
|
.LC1:
|
.LC1:
|
.ascii "Sorry Overflow..!\n\000"
|
.ascii "Sorry Overflow..!\n\000"
|
.rdata
|
.rdata
|
.align 0
|
.align 0
|
.align 2
|
.align 2
|
.LC2:
|
.LC2:
|
.ascii "\n"
|
.ascii "\n"
|
.ascii " parse error occurred\n\000"
|
.ascii " parse error occurred\n\000"
|
.rdata
|
.rdata
|
.align 0
|
.align 0
|
.align 2
|
.align 2
|
.LC3:
|
.LC3:
|
.ascii "\n\000"
|
.ascii "\n\000"
|
.align 2
|
.align 2
|
.LC4:
|
.LC4:
|
.ascii "=\000"
|
.ascii "=\000"
|
.align 2
|
.align 2
|
.LC5:
|
.LC5:
|
.ascii "[Hex] \000"
|
.ascii "[Hex] \000"
|
.align 2
|
.align 2
|
.LC6:
|
.LC6:
|
.ascii "[Dec]\n\000"
|
.ascii "[Dec]\n\000"
|
.rdata
|
.rdata
|
.align 0
|
.align 0
|
.align 2
|
.align 2
|
.LC7:
|
.LC7:
|
.ascii "5*3\n\000"
|
.ascii "5*3\n\000"
|
.align 2
|
.align 2
|
.LC8:
|
.LC8:
|
.ascii "100*31\n\000"
|
.ascii "100*31\n\000"
|
.align 2
|
.align 2
|
.LC9:
|
.LC9:
|
.ascii "(-31050)/(-31)\n\000"
|
.ascii "(-31050)/(-31)\n\000"
|
.align 2
|
.align 2
|
.LC10:
|
.LC10:
|
.ascii "(-1053333)/(231)\n\000"
|
.ascii "(-1053333)/(231)\n\000"
|
.align 2
|
.align 2
|
.LC11:
|
.LC11:
|
.ascii "(10503)/(-314)\n\000"
|
.ascii "(10503)/(-314)\n\000"
|
.align 2
|
.align 2
|
.LC12:
|
.LC12:
|
.ascii "3333*3333\n\000"
|
.ascii "3333*3333\n\000"
|
.align 2
|
.align 2
|
.LC13:
|
.LC13:
|
.ascii "533*443\n\000"
|
.ascii "533*443\n\000"
|
.align 2
|
.align 2
|
.LC14:
|
.LC14:
|
.ascii "10*314\n\000"
|
.ascii "10*314\n\000"
|
.align 2
|
.align 2
|
.LC15:
|
.LC15:
|
.ascii "(-350)/(-231)\n\000"
|
.ascii "(-350)/(-231)\n\000"
|
.align 2
|
.align 2
|
.LC16:
|
.LC16:
|
.ascii "(-10533333)/(1231)\n\000"
|
.ascii "(-10533333)/(1231)\n\000"
|
.align 2
|
.align 2
|
.LC17:
|
.LC17:
|
.ascii "(105034)/(-3134)\n\000"
|
.ascii "(105034)/(-3134)\n\000"
|
.align 2
|
.align 2
|
.LC18:
|
.LC18:
|
.ascii "3363*33333\n\000"
|
.ascii "3363*33333\n\000"
|
.align 2
|
.align 2
|
.LC19:
|
.LC19:
|
.ascii "$finish\000"
|
.ascii "$finish\000"
|
|
|
.comm read_ptr,4
|
.comm read_ptr,4
|
|
|
.comm buffer,120
|
.comm buffer,120
|
|
|
.comm result_buffer,8
|
.comm result_buffer,8
|
|
|
.comm sym,1
|
.comm sym,1
|
|
|
.comm char_ptr,4
|
.comm char_ptr,4
|
|
|
.comm buf,2
|
.comm buf,2
|
|
|
.text
|
.text
|
.text
|
.text
|
.align 2
|
.align 2
|
.globl print_uart
|
.globl print_uart
|
.ent print_uart
|
.ent print_uart
|
print_uart:
|
print_uart:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
lbu $v0,0($a0)
|
lbu $v0,0($a0)
|
beq $v0,$zero,.L3
|
beq $v0,$zero,.L3
|
li $v1,16380 # 0x00003ffc
|
li $v1,16380 # 0x00003ffc
|
.L5:
|
.L5:
|
#.set volatile
|
#.set volatile
|
lw $v0,0($v1)
|
lw $v0,0($v1)
|
#.set novolatile
|
#.set novolatile
|
andi $v0,$v0,0x0100
|
andi $v0,$v0,0x0100
|
bne $v0,$zero,.L5
|
bne $v0,$zero,.L5
|
lbu $v0,0($a0)
|
lbu $v0,0($a0)
|
#.set volatile
|
#.set volatile
|
sb $v0,0($v1)
|
sb $v0,0($v1)
|
#.set novolatile
|
#.set novolatile
|
addu $a0,$a0,1
|
addu $a0,$a0,1
|
lbu $v0,0($a0)
|
lbu $v0,0($a0)
|
bne $v0,$zero,.L5
|
bne $v0,$zero,.L5
|
.L3:
|
.L3:
|
j $ra
|
j $ra
|
.end print_uart
|
.end print_uart
|
.size print_uart,.-print_uart
|
.size print_uart,.-print_uart
|
.align 2
|
.align 2
|
.globl putc_uart
|
.globl putc_uart
|
.ent putc_uart
|
.ent putc_uart
|
putc_uart:
|
putc_uart:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
andi $a0,$a0,0x00ff
|
andi $a0,$a0,0x00ff
|
li $v1,16380 # 0x00003ffc
|
li $v1,16380 # 0x00003ffc
|
.L11:
|
.L11:
|
#.set volatile
|
#.set volatile
|
lw $v0,0($v1)
|
lw $v0,0($v1)
|
#.set novolatile
|
#.set novolatile
|
andi $v0,$v0,0x0100
|
andi $v0,$v0,0x0100
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v0,$zero,.L11
|
bne $v0,$zero,.L11
|
li $v0,16380 # 0x00003ffc
|
li $v0,16380 # 0x00003ffc
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
#.set volatile
|
#.set volatile
|
sb $a0,0($v0)
|
sb $a0,0($v0)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end putc_uart
|
.end putc_uart
|
.size putc_uart,.-putc_uart
|
.size putc_uart,.-putc_uart
|
.align 2
|
.align 2
|
.globl print_char
|
.globl print_char
|
.ent print_char
|
.ent print_char
|
print_char:
|
print_char:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
andi $a0,$a0,0x00ff
|
andi $a0,$a0,0x00ff
|
li $v0,16369 # 0x00003ff1
|
li $v0,16369 # 0x00003ff1
|
#.set volatile
|
#.set volatile
|
sb $a0,0($v0)
|
sb $a0,0($v0)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end print_char
|
.end print_char
|
.size print_char,.-print_char
|
.size print_char,.-print_char
|
.align 2
|
.align 2
|
.globl read_uart
|
.globl read_uart
|
.ent read_uart
|
.ent read_uart
|
read_uart:
|
read_uart:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
li $v0,16380 # 0x00003ffc
|
li $v0,16380 # 0x00003ffc
|
#.set volatile
|
#.set volatile
|
lw $v0,0($v0)
|
lw $v0,0($v0)
|
#.set novolatile
|
#.set novolatile
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
andi $v0,$v0,0x00ff
|
andi $v0,$v0,0x00ff
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end read_uart
|
.end read_uart
|
.size read_uart,.-read_uart
|
.size read_uart,.-read_uart
|
.align 2
|
.align 2
|
.globl print
|
.globl print
|
.ent print
|
.ent print
|
print:
|
print:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
lbu $v0,0($a0)
|
lbu $v0,0($a0)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L19
|
beq $v0,$zero,.L19
|
move $v1,$v0
|
move $v1,$v0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
li $a1,16368 # 0x00003ff0
|
li $a1,16368 # 0x00003ff0
|
move $v0,$v1
|
move $v0,$v1
|
.L22:
|
.L22:
|
#.set volatile
|
#.set volatile
|
sb $v0,0($a1)
|
sb $v0,0($a1)
|
#.set novolatile
|
#.set novolatile
|
addu $a0,$a0,1
|
addu $a0,$a0,1
|
lbu $v1,0($a0)
|
lbu $v1,0($a0)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v1,$zero,.L22
|
bne $v1,$zero,.L22
|
move $v0,$v1
|
move $v0,$v1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L19:
|
.L19:
|
li $v0,16368 # 0x00003ff0
|
li $v0,16368 # 0x00003ff0
|
#.set volatile
|
#.set volatile
|
sb $zero,0($v0)
|
sb $zero,0($v0)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end print
|
.end print
|
.size print,.-print
|
.size print,.-print
|
.align 2
|
.align 2
|
.globl print_short
|
.globl print_short
|
.ent print_short
|
.ent print_short
|
print_short:
|
print_short:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
sll $a0,$a0,16
|
sll $a0,$a0,16
|
sra $a0,$a0,16
|
sra $a0,$a0,16
|
li $v0,16370 # 0x00003ff2
|
li $v0,16370 # 0x00003ff2
|
#.set volatile
|
#.set volatile
|
sh $a0,0($v0)
|
sh $a0,0($v0)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end print_short
|
.end print_short
|
.size print_short,.-print_short
|
.size print_short,.-print_short
|
.align 2
|
.align 2
|
.globl print_long
|
.globl print_long
|
.ent print_long
|
.ent print_long
|
print_long:
|
print_long:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
li $v0,16372 # 0x00003ff4
|
li $v0,16372 # 0x00003ff4
|
#.set volatile
|
#.set volatile
|
sw $a0,0($v0)
|
sw $a0,0($v0)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end print_long
|
.end print_long
|
.size print_long,.-print_long
|
.size print_long,.-print_long
|
.text
|
.text
|
.align 2
|
.align 2
|
.globl interrupt
|
.globl interrupt
|
.ent interrupt
|
.ent interrupt
|
interrupt:
|
interrupt:
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.mask 0x80010000,-4
|
.mask 0x80010000,-4
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,20($sp)
|
sw $ra,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
#APP
|
#APP
|
addiu $sp,$sp,-52 ;
|
addiu $sp,$sp,-52 ;
|
sw $a0,($sp)
|
sw $a0,($sp)
|
sw $v0,4($sp)
|
sw $v0,4($sp)
|
sw $v1,8($sp)
|
sw $v1,8($sp)
|
sw $a1,12($sp)
|
sw $a1,12($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
sw $s1,20($sp)
|
sw $s1,20($sp)
|
sw $s2,24($sp)
|
sw $s2,24($sp)
|
sw $a3,28($sp)
|
sw $a3,28($sp)
|
sw $s4,32($sp)
|
sw $s4,32($sp)
|
sw $s5,36($sp)
|
sw $s5,36($sp)
|
sw $s6,40($sp)
|
sw $s6,40($sp)
|
sw $s7,44($sp)
|
sw $s7,44($sp)
|
sw $a2,48($sp)
|
sw $a2,48($sp)
|
#NO_APP
|
#NO_APP
|
jal read_uart
|
jal read_uart
|
move $s0,$v0
|
move $s0,$v0
|
xori $v1,$s0,0x000a
|
xori $v1,$s0,0x000a
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$s0,0x000d
|
xori $v0,$s0,0x000d
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v1,$zero,.L26
|
beq $v1,$zero,.L26
|
li $v0,8 # 0x00000008
|
li $v0,8 # 0x00000008
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $v0,read_ptr
|
lw $v0,read_ptr
|
sb $zero,0($v0)
|
sb $zero,0($v0)
|
lui $v0,%hi(buffer) # high
|
lui $v0,%hi(buffer) # high
|
addiu $v0,$v0,%lo(buffer) # low
|
addiu $v0,$v0,%lo(buffer) # low
|
sw $v0,read_ptr
|
sw $v0,read_ptr
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal putc_uart
|
jal putc_uart
|
li $a0,10 # 0x0000000a
|
li $a0,10 # 0x0000000a
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal putc_uart
|
jal putc_uart
|
li $a0,13 # 0x0000000d
|
li $a0,13 # 0x0000000d
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
#.set volatile
|
#.set volatile
|
lw $v0,int_flag
|
lw $v0,int_flag
|
#.set novolatile
|
#.set novolatile
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L27
|
beq $v0,$zero,.L27
|
lui $a0,%hi(.LC0) # high
|
lui $a0,%hi(.LC0) # high
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC0) # low
|
addiu $a0,$a0,%lo(.LC0) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
b .L29
|
b .L29
|
.L27:
|
.L27:
|
li $v0,1 # 0x00000001
|
li $v0,1 # 0x00000001
|
#.set volatile
|
#.set volatile
|
sw $v0,int_flag
|
sw $v0,int_flag
|
#.set novolatile
|
#.set novolatile
|
b .L29
|
b .L29
|
.L26:
|
.L26:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $s0,$v0,.L30
|
bne $s0,$v0,.L30
|
lui $v0,%hi(buffer) # high
|
lui $v0,%hi(buffer) # high
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $v1,read_ptr
|
lw $v1,read_ptr
|
addiu $v0,$v0,%lo(buffer) # low
|
addiu $v0,$v0,%lo(buffer) # low
|
sltu $v0,$v0,$v1
|
sltu $v0,$v0,$v1
|
beq $v0,$zero,.L35
|
beq $v0,$zero,.L35
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal putc_uart
|
jal putc_uart
|
li $a0,8 # 0x00000008
|
li $a0,8 # 0x00000008
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $v0,read_ptr
|
lw $v0,read_ptr
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L34
|
b .L34
|
addu $v0,$v0,-1
|
addu $v0,$v0,-1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L30:
|
.L30:
|
lw $v1,read_ptr
|
lw $v1,read_ptr
|
.L35:
|
.L35:
|
lui $v0,%hi(buffer+120) # high
|
lui $v0,%hi(buffer+120) # high
|
addiu $a0,$v0,%lo(buffer+120) # low
|
addiu $a0,$v0,%lo(buffer+120) # low
|
sltu $v0,$v1,$a0
|
sltu $v0,$v1,$a0
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v0,$zero,.L32
|
bne $v0,$zero,.L32
|
addu $v0,$a0,-120
|
addu $v0,$a0,-120
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
sb $zero,0($v1)
|
sb $zero,0($v1)
|
sw $v0,read_ptr
|
sw $v0,read_ptr
|
lui $a0,%hi(.LC1) # high
|
lui $a0,%hi(.LC1) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC1) # low
|
addiu $a0,$a0,%lo(.LC1) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
b .L29
|
b .L29
|
.L32:
|
.L32:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal putc_uart
|
jal putc_uart
|
move $a0,$s0
|
move $a0,$s0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $v0,read_ptr
|
lw $v0,read_ptr
|
sb $s0,0($v0)
|
sb $s0,0($v0)
|
addu $v0,$v0,1
|
addu $v0,$v0,1
|
.L34:
|
.L34:
|
sw $v0,read_ptr
|
sw $v0,read_ptr
|
.L29:
|
.L29:
|
#APP
|
#APP
|
lw $a0,($sp)
|
lw $a0,($sp)
|
lw $v0,4($sp)
|
lw $v0,4($sp)
|
lw $v1,8($sp)
|
lw $v1,8($sp)
|
lw $a1,12($sp)
|
lw $a1,12($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
lw $s1,20($sp)
|
lw $s1,20($sp)
|
lw $s2,24($sp)
|
lw $s2,24($sp)
|
lw $a3,28($sp)
|
lw $a3,28($sp)
|
lw $s4,32($sp)
|
lw $s4,32($sp)
|
lw $s5,36($sp)
|
lw $s5,36($sp)
|
lw $s6,40($sp)
|
lw $s6,40($sp)
|
lw $s7,44($sp)
|
lw $s7,44($sp)
|
lw $a2,48($sp)
|
lw $a2,48($sp)
|
addiu $sp,$sp,52 ;
|
addiu $sp,$sp,52 ;
|
lw $ra,20($sp);
|
lw $ra,20($sp);
|
addiu $sp,$sp,24 ;
|
addiu $sp,$sp,24 ;
|
jr $26
|
jr $26
|
nop
|
nop
|
#NO_APP
|
#NO_APP
|
lw $ra,20($sp)
|
lw $ra,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end interrupt
|
.end interrupt
|
.size interrupt,.-interrupt
|
.size interrupt,.-interrupt
|
.align 2
|
.align 2
|
.globl print_longlong
|
.globl print_longlong
|
.ent print_longlong
|
.ent print_longlong
|
print_longlong:
|
print_longlong:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
li $a2,16372 # 0x00003ff4
|
li $a2,16372 # 0x00003ff4
|
sra $v1,$a0,0
|
sra $v1,$a0,0
|
sra $v0,$a0,31
|
sra $v0,$a0,31
|
#.set volatile
|
#.set volatile
|
sw $v1,0($a2)
|
sw $v1,0($a2)
|
#.set novolatile
|
#.set novolatile
|
#.set volatile
|
#.set volatile
|
sw $a1,0($a2)
|
sw $a1,0($a2)
|
#.set novolatile
|
#.set novolatile
|
j $ra
|
j $ra
|
.end print_longlong
|
.end print_longlong
|
.size print_longlong,.-print_longlong
|
.size print_longlong,.-print_longlong
|
.align 2
|
.align 2
|
.globl getsym
|
.globl getsym
|
.ent getsym
|
.ent getsym
|
getsym:
|
getsym:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
lw $v0,char_ptr
|
lw $v0,char_ptr
|
lbu $a0,0($v0)
|
lbu $a0,0($v0)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L47
|
b .L47
|
xori $v1,$a0,0x0020
|
xori $v1,$a0,0x0020
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L42:
|
.L42:
|
lw $v1,char_ptr
|
lw $v1,char_ptr
|
addu $v0,$v1,1
|
addu $v0,$v1,1
|
sw $v0,char_ptr
|
sw $v0,char_ptr
|
lbu $a0,1($v1)
|
lbu $a0,1($v1)
|
xori $v1,$a0,0x0020
|
xori $v1,$a0,0x0020
|
.L47:
|
.L47:
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$a0,0x000a
|
xori $v0,$a0,0x000a
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v1,$zero,.L42
|
bne $v1,$zero,.L42
|
li $v0,13 # 0x0000000d
|
li $v0,13 # 0x0000000d
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
beq $a0,$v0,.L42
|
beq $a0,$v0,.L42
|
lw $v0,char_ptr
|
lw $v0,char_ptr
|
lbu $v0,0($v0)
|
lbu $v0,0($v0)
|
bne $v0,$zero,.L44
|
bne $v0,$zero,.L44
|
sb $zero,sym
|
sb $zero,sym
|
b .L45
|
b .L45
|
.L44:
|
.L44:
|
lw $v0,char_ptr
|
lw $v0,char_ptr
|
lbu $v1,0($v0)
|
lbu $v1,0($v0)
|
sb $v1,sym
|
sb $v1,sym
|
addu $v0,$v0,1
|
addu $v0,$v0,1
|
sw $v0,char_ptr
|
sw $v0,char_ptr
|
.L45:
|
.L45:
|
j $ra
|
j $ra
|
.end getsym
|
.end getsym
|
.size getsym,.-getsym
|
.size getsym,.-getsym
|
.align 2
|
.align 2
|
.globl evaluate_number
|
.globl evaluate_number
|
.ent evaluate_number
|
.ent evaluate_number
|
evaluate_number:
|
evaluate_number:
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.mask 0x80010000,-4
|
.mask 0x80010000,-4
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,20($sp)
|
sw $ra,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
lbu $s0,sym
|
lbu $s0,sym
|
lw $v0,char_ptr
|
lw $v0,char_ptr
|
move $v1,$v0
|
move $v1,$v0
|
lbu $v0,0($v0)
|
lbu $v0,0($v0)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L55
|
b .L55
|
addu $s0,$s0,-48
|
addu $s0,$s0,-48
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L53:
|
.L53:
|
addu $v0,$v0,$s0
|
addu $v0,$v0,$s0
|
sll $v0,$v0,1
|
sll $v0,$v0,1
|
move $a0,$v1
|
move $a0,$v1
|
lbu $v1,0($a0)
|
lbu $v1,0($a0)
|
addu $v0,$v0,$v1
|
addu $v0,$v0,$v1
|
addu $s0,$v0,-48
|
addu $s0,$v0,-48
|
addu $v0,$a0,1
|
addu $v0,$a0,1
|
sw $v0,char_ptr
|
sw $v0,char_ptr
|
move $v1,$v0
|
move $v1,$v0
|
lbu $v0,1($a0)
|
lbu $v0,1($a0)
|
.L55:
|
.L55:
|
addu $v0,$v0,-48
|
addu $v0,$v0,-48
|
sltu $v0,$v0,10
|
sltu $v0,$v0,10
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v0,$zero,.L53
|
bne $v0,$zero,.L53
|
sll $v0,$s0,2
|
sll $v0,$s0,2
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
jal getsym
|
jal getsym
|
move $v0,$s0
|
move $v0,$s0
|
lw $ra,20($sp)
|
lw $ra,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end evaluate_number
|
.end evaluate_number
|
.size evaluate_number,.-evaluate_number
|
.size evaluate_number,.-evaluate_number
|
.align 2
|
.align 2
|
.globl expression
|
.globl expression
|
.ent expression
|
.ent expression
|
expression:
|
expression:
|
.frame $sp,32,$ra # vars= 0, regs= 4/0, args= 16, extra= 0
|
.frame $sp,32,$ra # vars= 0, regs= 4/0, args= 16, extra= 0
|
.mask 0x80070000,-4
|
.mask 0x80070000,-4
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,32
|
subu $sp,$sp,32
|
sw $ra,28($sp)
|
sw $ra,28($sp)
|
sw $s2,24($sp)
|
sw $s2,24($sp)
|
sw $s1,20($sp)
|
sw $s1,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
lbu $s0,sym
|
lbu $s0,sym
|
xori $v1,$s0,0x002b
|
xori $v1,$s0,0x002b
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$s0,0x002d
|
xori $v0,$s0,0x002d
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
beq $v1,$zero,.L57
|
beq $v1,$zero,.L57
|
jal getsym
|
jal getsym
|
.L57:
|
.L57:
|
jal term
|
jal term
|
move $s1,$v0
|
move $s1,$v0
|
li $v0,45 # 0x0000002d
|
li $v0,45 # 0x0000002d
|
bne $s0,$v0,.L58
|
bne $s0,$v0,.L58
|
subu $s1,$zero,$s1
|
subu $s1,$zero,$s1
|
.L58:
|
.L58:
|
lbu $v0,sym
|
lbu $v0,sym
|
move $a0,$v0
|
move $a0,$v0
|
andi $v0,$v0,0x00ff
|
andi $v0,$v0,0x00ff
|
xori $v1,$v0,0x002b
|
xori $v1,$v0,0x002b
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$v0,0x002d
|
xori $v0,$v0,0x002d
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v1,$zero,.L60
|
beq $v1,$zero,.L60
|
li $s2,43 # 0x0000002b
|
li $s2,43 # 0x0000002b
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L61:
|
.L61:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal getsym
|
jal getsym
|
move $s0,$a0
|
move $s0,$a0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
jal term
|
jal term
|
bne $s0,$s2,.L62
|
bne $s0,$s2,.L62
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L59
|
b .L59
|
addu $s1,$s1,$v0
|
addu $s1,$s1,$v0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L62:
|
.L62:
|
subu $s1,$s1,$v0
|
subu $s1,$s1,$v0
|
.L59:
|
.L59:
|
lbu $a0,sym
|
lbu $a0,sym
|
andi $v0,$a0,0x00ff
|
andi $v0,$a0,0x00ff
|
xori $v1,$v0,0x002b
|
xori $v1,$v0,0x002b
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$v0,0x002d
|
xori $v0,$v0,0x002d
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
bne $v1,$zero,.L61
|
bne $v1,$zero,.L61
|
.L60:
|
.L60:
|
move $v0,$s1
|
move $v0,$s1
|
lw $ra,28($sp)
|
lw $ra,28($sp)
|
lw $s2,24($sp)
|
lw $s2,24($sp)
|
lw $s1,20($sp)
|
lw $s1,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,32
|
addu $sp,$sp,32
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end expression
|
.end expression
|
.size expression,.-expression
|
.size expression,.-expression
|
.align 2
|
.align 2
|
.globl term
|
.globl term
|
.ent term
|
.ent term
|
term:
|
term:
|
.frame $sp,32,$ra # vars= 0, regs= 3/0, args= 16, extra= 0
|
.frame $sp,32,$ra # vars= 0, regs= 3/0, args= 16, extra= 0
|
.mask 0x80030000,-8
|
.mask 0x80030000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,32
|
subu $sp,$sp,32
|
sw $ra,24($sp)
|
sw $ra,24($sp)
|
sw $s1,20($sp)
|
sw $s1,20($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal factor
|
jal factor
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L66
|
b .L66
|
move $s1,$v0
|
move $s1,$v0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L68:
|
.L68:
|
lbu $s0,sym
|
lbu $s0,sym
|
jal getsym
|
jal getsym
|
jal factor
|
jal factor
|
move $v1,$v0
|
move $v1,$v0
|
li $v0,42 # 0x0000002a
|
li $v0,42 # 0x0000002a
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $s0,$v0,.L70
|
beq $s0,$v0,.L70
|
slt $v0,$s0,43
|
slt $v0,$s0,43
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L75
|
beq $v0,$zero,.L75
|
li $v0,37 # 0x00000025
|
li $v0,37 # 0x00000025
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
beq $s0,$v0,.L72
|
beq $s0,$v0,.L72
|
b .L66
|
b .L66
|
.L75:
|
.L75:
|
li $v0,47 # 0x0000002f
|
li $v0,47 # 0x0000002f
|
beq $s0,$v0,.L71
|
beq $s0,$v0,.L71
|
b .L66
|
b .L66
|
.L70:
|
.L70:
|
mult $s1,$v1
|
mult $s1,$v1
|
mflo $s1
|
mflo $s1
|
b .L66
|
b .L66
|
.L71:
|
.L71:
|
div $s1,$s1,$v1
|
div $s1,$s1,$v1
|
b .L66
|
b .L66
|
.L72:
|
.L72:
|
rem $s1,$s1,$v1
|
rem $s1,$s1,$v1
|
.L66:
|
.L66:
|
lbu $a0,sym
|
lbu $a0,sym
|
xori $v1,$a0,0x002a
|
xori $v1,$a0,0x002a
|
sltu $v1,$v1,1
|
sltu $v1,$v1,1
|
xori $v0,$a0,0x002f
|
xori $v0,$a0,0x002f
|
sltu $v0,$v0,1
|
sltu $v0,$v0,1
|
or $v1,$v1,$v0
|
or $v1,$v1,$v0
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v1,$zero,.L68
|
bne $v1,$zero,.L68
|
li $v0,37 # 0x00000025
|
li $v0,37 # 0x00000025
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $a0,$v0,.L68
|
beq $a0,$v0,.L68
|
move $v0,$s1
|
move $v0,$s1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $ra,24($sp)
|
lw $ra,24($sp)
|
lw $s1,20($sp)
|
lw $s1,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,32
|
addu $sp,$sp,32
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end term
|
.end term
|
.size term,.-term
|
.size term,.-term
|
.text
|
.text
|
.align 2
|
.align 2
|
.globl factor
|
.globl factor
|
.ent factor
|
.ent factor
|
factor:
|
factor:
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.mask 0x80010000,-4
|
.mask 0x80010000,-4
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,20($sp)
|
sw $ra,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
lbu $v0,sym
|
lbu $v0,sym
|
addu $v0,$v0,-48
|
addu $v0,$v0,-48
|
sltu $v0,$v0,10
|
sltu $v0,$v0,10
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L80
|
beq $v0,$zero,.L80
|
li $v0,40 # 0x00000028
|
li $v0,40 # 0x00000028
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
jal evaluate_number
|
jal evaluate_number
|
b .L89
|
b .L89
|
.L80:
|
.L80:
|
lbu $v1,sym
|
lbu $v1,sym
|
bne $v1,$v0,.L82
|
bne $v1,$v0,.L82
|
jal getsym
|
jal getsym
|
jal expression
|
jal expression
|
move $s0,$v0
|
move $s0,$v0
|
lbu $v1,sym
|
lbu $v1,sym
|
li $v0,41 # 0x00000029
|
li $v0,41 # 0x00000029
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v1,$v0,.L83
|
beq $v1,$v0,.L83
|
lui $a0,%hi(.LC2) # high
|
lui $a0,%hi(.LC2) # high
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC2) # low
|
addiu $a0,$a0,%lo(.LC2) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L83:
|
.L83:
|
jal getsym
|
jal getsym
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L89
|
b .L89
|
move $v0,$s0
|
move $v0,$s0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L82:
|
.L82:
|
lbu $v0,sym
|
lbu $v0,sym
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L89
|
beq $v0,$zero,.L89
|
move $v0,$zero
|
move $v0,$zero
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC2) # high
|
lui $a0,%hi(.LC2) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC2) # low
|
addiu $a0,$a0,%lo(.LC2) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
move $v0,$zero
|
move $v0,$zero
|
.L89:
|
.L89:
|
lw $ra,20($sp)
|
lw $ra,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end factor
|
.end factor
|
.size factor,.-factor
|
.size factor,.-factor
|
.align 2
|
.align 2
|
.globl strrev
|
.globl strrev
|
.ent strrev
|
.ent strrev
|
strrev:
|
strrev:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
move $a2,$a0
|
move $a2,$a0
|
lbu $v0,0($a0)
|
lbu $v0,0($a0)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L99
|
beq $v0,$zero,.L99
|
move $a1,$a0
|
move $a1,$a0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
addu $a1,$a1,1
|
addu $a1,$a1,1
|
.L101:
|
.L101:
|
lbu $v0,0($a1)
|
lbu $v0,0($a1)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v0,$zero,.L101
|
bne $v0,$zero,.L101
|
addu $a1,$a1,1
|
addu $a1,$a1,1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
addu $a1,$a1,-1
|
addu $a1,$a1,-1
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
b .L100
|
b .L100
|
addu $a1,$a1,-1
|
addu $a1,$a1,-1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L97:
|
.L97:
|
lbu $v0,0($a2)
|
lbu $v0,0($a2)
|
lbu $v1,0($a1)
|
lbu $v1,0($a1)
|
sb $v1,0($a2)
|
sb $v1,0($a2)
|
sb $v0,0($a1)
|
sb $v0,0($a1)
|
addu $a2,$a2,1
|
addu $a2,$a2,1
|
.L99:
|
.L99:
|
addu $a1,$a1,-1
|
addu $a1,$a1,-1
|
.L100:
|
.L100:
|
sltu $v0,$a2,$a1
|
sltu $v0,$a2,$a1
|
bne $v0,$zero,.L97
|
bne $v0,$zero,.L97
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
move $v0,$a0
|
move $v0,$a0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end strrev
|
.end strrev
|
.size strrev,.-strrev
|
.size strrev,.-strrev
|
.align 2
|
.align 2
|
.globl itoa
|
.globl itoa
|
.ent itoa
|
.ent itoa
|
itoa:
|
itoa:
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.mask 0x80000000,-8
|
.mask 0x80000000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bgez $a0,.L103
|
bgez $a0,.L103
|
sw $ra,16($sp)
|
sw $ra,16($sp)
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
li $v0,45 # 0x0000002d
|
li $v0,45 # 0x0000002d
|
sb $v0,0($a1)
|
sb $v0,0($a1)
|
addu $a1,$a1,1
|
addu $a1,$a1,1
|
subu $a0,$zero,$a0
|
subu $a0,$zero,$a0
|
.L103:
|
.L103:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $a0,$zero,.L105
|
beq $a0,$zero,.L105
|
move $a3,$a1
|
move $a3,$a1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
li $t0,1717960704 # 0x66660000
|
li $t0,1717960704 # 0x66660000
|
ori $t0,$t0,0x6667
|
ori $t0,$t0,0x6667
|
.L106:
|
.L106:
|
mult $a0,$t0
|
mult $a0,$t0
|
mfhi $t1
|
mfhi $t1
|
sra $v1,$t1,2
|
sra $v1,$t1,2
|
sra $v0,$a0,31
|
sra $v0,$a0,31
|
subu $a2,$v1,$v0
|
subu $a2,$v1,$v0
|
move $v1,$a2
|
move $v1,$a2
|
sll $v0,$a2,2
|
sll $v0,$a2,2
|
addu $v0,$v0,$a2
|
addu $v0,$v0,$a2
|
sll $v0,$v0,1
|
sll $v0,$v0,1
|
subu $a2,$a0,$v0
|
subu $a2,$a0,$v0
|
addu $v0,$a2,48
|
addu $v0,$a2,48
|
sb $v0,0($a3)
|
sb $v0,0($a3)
|
move $a0,$v1
|
move $a0,$v1
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $a0,$zero,.L106
|
bne $a0,$zero,.L106
|
addu $a3,$a3,1
|
addu $a3,$a3,1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L105:
|
.L105:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $a1,$a3,.L108
|
bne $a1,$a3,.L108
|
li $v0,48 # 0x00000030
|
li $v0,48 # 0x00000030
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
sb $v0,0($a1)
|
sb $v0,0($a1)
|
addu $a3,$a1,1
|
addu $a3,$a1,1
|
.L108:
|
.L108:
|
sb $zero,0($a3)
|
sb $zero,0($a3)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal strrev
|
jal strrev
|
move $a0,$a1
|
move $a0,$a1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $ra,16($sp)
|
lw $ra,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end itoa
|
.end itoa
|
.size itoa,.-itoa
|
.size itoa,.-itoa
|
.text
|
.text
|
.align 2
|
.align 2
|
.globl calculator
|
.globl calculator
|
.ent calculator
|
.ent calculator
|
calculator:
|
calculator:
|
.frame $sp,32,$ra # vars= 0, regs= 3/0, args= 16, extra= 0
|
.frame $sp,32,$ra # vars= 0, regs= 3/0, args= 16, extra= 0
|
.mask 0x80030000,-8
|
.mask 0x80030000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,32
|
subu $sp,$sp,32
|
sw $ra,24($sp)
|
sw $ra,24($sp)
|
sw $s1,20($sp)
|
sw $s1,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
lui $s0,%hi(buffer) # high
|
lui $s0,%hi(buffer) # high
|
addiu $s0,$s0,%lo(buffer) # low
|
addiu $s0,$s0,%lo(buffer) # low
|
sw $s0,char_ptr
|
sw $s0,char_ptr
|
jal getsym
|
jal getsym
|
jal expression
|
jal expression
|
move $s1,$v0
|
move $s1,$v0
|
lui $a0,%hi(.LC3) # high
|
lui $a0,%hi(.LC3) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC3) # low
|
addiu $a0,$a0,%lo(.LC3) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
move $a0,$s0
|
move $a0,$s0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC4) # high
|
lui $a0,%hi(.LC4) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC4) # low
|
addiu $a0,$a0,%lo(.LC4) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_long
|
jal print_long
|
move $a0,$s1
|
move $a0,$s1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC5) # high
|
lui $a0,%hi(.LC5) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC5) # low
|
addiu $a0,$a0,%lo(.LC5) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
la $a1,result_buffer
|
la $a1,result_buffer
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal itoa
|
jal itoa
|
move $a0,$s1
|
move $a0,$s1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
la $a0,result_buffer
|
la $a0,result_buffer
|
jal print
|
jal print
|
lui $a0,%hi(.LC6) # high
|
lui $a0,%hi(.LC6) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC6) # low
|
addiu $a0,$a0,%lo(.LC6) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lw $ra,24($sp)
|
lw $ra,24($sp)
|
lw $s1,20($sp)
|
lw $s1,20($sp)
|
lw $s0,16($sp)
|
lw $s0,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,32
|
addu $sp,$sp,32
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end calculator
|
.end calculator
|
.size calculator,.-calculator
|
.size calculator,.-calculator
|
.align 2
|
.align 2
|
.globl strcpy
|
.globl strcpy
|
.ent strcpy
|
.ent strcpy
|
strcpy:
|
strcpy:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
lbu $v0,0($a1)
|
lbu $v0,0($a1)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
beq $v0,$zero,.L113
|
beq $v0,$zero,.L113
|
move $v1,$v0
|
move $v1,$v0
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L114:
|
.L114:
|
sb $v1,0($a0)
|
sb $v1,0($a0)
|
addu $a1,$a1,1
|
addu $a1,$a1,1
|
lbu $v1,0($a1)
|
lbu $v1,0($a1)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
bne $v1,$zero,.L114
|
bne $v1,$zero,.L114
|
addu $a0,$a0,1
|
addu $a0,$a0,1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L113:
|
.L113:
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
sb $zero,0($a0)
|
sb $zero,0($a0)
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end strcpy
|
.end strcpy
|
.size strcpy,.-strcpy
|
.size strcpy,.-strcpy
|
.align 2
|
.align 2
|
.globl calculator_test
|
.globl calculator_test
|
.ent calculator_test
|
.ent calculator_test
|
calculator_test:
|
calculator_test:
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.mask 0x80000000,-8
|
.mask 0x80000000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,16($sp)
|
sw $ra,16($sp)
|
move $a1,$a0
|
move $a1,$a0
|
lui $a0,%hi(buffer) # high
|
lui $a0,%hi(buffer) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal strcpy
|
jal strcpy
|
addiu $a0,$a0,%lo(buffer) # low
|
addiu $a0,$a0,%lo(buffer) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
jal calculator
|
jal calculator
|
lw $ra,16($sp)
|
lw $ra,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end calculator_test
|
.end calculator_test
|
.size calculator_test,.-calculator_test
|
.size calculator_test,.-calculator_test
|
.text
|
.text
|
.align 2
|
.align 2
|
.globl main2
|
.globl main2
|
.ent main2
|
.ent main2
|
main2:
|
main2:
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 2/0, args= 16, extra= 0
|
.mask 0x80010000,-4
|
.mask 0x80010000,-4
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,20($sp)
|
sw $ra,20($sp)
|
sw $s0,16($sp)
|
sw $s0,16($sp)
|
move $s0,$zero
|
move $s0,$zero
|
li $v1,16376 # 0x00003ff8
|
li $v1,16376 # 0x00003ff8
|
lui $v0,%hi(interrupt) # high
|
lui $v0,%hi(interrupt) # high
|
addiu $v0,$v0,%lo(interrupt) # low
|
addiu $v0,$v0,%lo(interrupt) # low
|
#.set volatile
|
#.set volatile
|
sw $v0,0($v1)
|
sw $v0,0($v1)
|
#.set novolatile
|
#.set novolatile
|
lui $v0,%hi(buffer) # high
|
lui $v0,%hi(buffer) # high
|
addiu $v0,$v0,%lo(buffer) # low
|
addiu $v0,$v0,%lo(buffer) # low
|
sw $v0,read_ptr
|
sw $v0,read_ptr
|
lui $a0,%hi(.LC7) # high
|
lui $a0,%hi(.LC7) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC7) # low
|
addiu $a0,$a0,%lo(.LC7) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC8) # high
|
lui $a0,%hi(.LC8) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC8) # low
|
addiu $a0,$a0,%lo(.LC8) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC9) # high
|
lui $a0,%hi(.LC9) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC9) # low
|
addiu $a0,$a0,%lo(.LC9) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC10) # high
|
lui $a0,%hi(.LC10) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC10) # low
|
addiu $a0,$a0,%lo(.LC10) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC11) # high
|
lui $a0,%hi(.LC11) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC11) # low
|
addiu $a0,$a0,%lo(.LC11) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC12) # high
|
lui $a0,%hi(.LC12) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC12) # low
|
addiu $a0,$a0,%lo(.LC12) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC13) # high
|
lui $a0,%hi(.LC13) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC13) # low
|
addiu $a0,$a0,%lo(.LC13) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC14) # high
|
lui $a0,%hi(.LC14) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC14) # low
|
addiu $a0,$a0,%lo(.LC14) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC15) # high
|
lui $a0,%hi(.LC15) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC15) # low
|
addiu $a0,$a0,%lo(.LC15) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC16) # high
|
lui $a0,%hi(.LC16) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC16) # low
|
addiu $a0,$a0,%lo(.LC16) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC17) # high
|
lui $a0,%hi(.LC17) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC17) # low
|
addiu $a0,$a0,%lo(.LC17) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
lui $a0,%hi(.LC18) # high
|
lui $a0,%hi(.LC18) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC18) # low
|
addiu $a0,$a0,%lo(.LC18) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.L119:
|
.L119:
|
#.set volatile
|
#.set volatile
|
lw $v0,int_flag
|
lw $v0,int_flag
|
#.set novolatile
|
#.set novolatile
|
beq $v0,$zero,.L119
|
beq $v0,$zero,.L119
|
#.set volatile
|
#.set volatile
|
sw $zero,int_flag
|
sw $zero,int_flag
|
#.set novolatile
|
#.set novolatile
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal calculator
|
jal calculator
|
addu $s0,$s0,1
|
addu $s0,$s0,1
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
sltu $v0,$s0,12
|
sltu $v0,$s0,12
|
bne $v0,$zero,.L119
|
bne $v0,$zero,.L119
|
lui $a0,%hi(.LC19) # high
|
lui $a0,%hi(.LC19) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print
|
jal print
|
addiu $a0,$a0,%lo(.LC19) # low
|
addiu $a0,$a0,%lo(.LC19) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
b .L119
|
b .L119
|
.end main2
|
.end main2
|
.size main2,.-main2
|
.size main2,.-main2
|
.align 2
|
.align 2
|
.globl set_interrupt_address
|
.globl set_interrupt_address
|
.ent set_interrupt_address
|
.ent set_interrupt_address
|
set_interrupt_address:
|
set_interrupt_address:
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.frame $sp,0,$ra # vars= 0, regs= 0/0, args= 0, extra= 0
|
.mask 0x00000000,0
|
.mask 0x00000000,0
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
li $v0,16376 # 0x00003ff8
|
li $v0,16376 # 0x00003ff8
|
lui $v1,%hi(interrupt) # high
|
lui $v1,%hi(interrupt) # high
|
addiu $v1,$v1,%lo(interrupt) # low
|
addiu $v1,$v1,%lo(interrupt) # low
|
#.set volatile
|
#.set volatile
|
sw $v1,0($v0)
|
sw $v1,0($v0)
|
#.set novolatile
|
#.set novolatile
|
lui $v0,%hi(buffer) # high
|
lui $v0,%hi(buffer) # high
|
addiu $v0,$v0,%lo(buffer) # low
|
addiu $v0,$v0,%lo(buffer) # low
|
sw $v0,read_ptr
|
sw $v0,read_ptr
|
j $ra
|
j $ra
|
.end set_interrupt_address
|
.end set_interrupt_address
|
.size set_interrupt_address,.-set_interrupt_address
|
.size set_interrupt_address,.-set_interrupt_address
|
.align 2
|
.align 2
|
.globl init_parser
|
.globl init_parser
|
.ent init_parser
|
.ent init_parser
|
init_parser:
|
init_parser:
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.mask 0x80000000,-8
|
.mask 0x80000000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,16($sp)
|
sw $ra,16($sp)
|
lui $v0,%hi(buffer) # high
|
lui $v0,%hi(buffer) # high
|
addiu $v0,$v0,%lo(buffer) # low
|
addiu $v0,$v0,%lo(buffer) # low
|
sw $v0,char_ptr
|
sw $v0,char_ptr
|
jal getsym
|
jal getsym
|
lw $ra,16($sp)
|
lw $ra,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end init_parser
|
.end init_parser
|
.size init_parser,.-init_parser
|
.size init_parser,.-init_parser
|
.align 2
|
.align 2
|
.globl parse_error
|
.globl parse_error
|
.ent parse_error
|
.ent parse_error
|
parse_error:
|
parse_error:
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.frame $sp,24,$ra # vars= 0, regs= 1/0, args= 16, extra= 0
|
.mask 0x80000000,-8
|
.mask 0x80000000,-8
|
.fmask 0x00000000,0
|
.fmask 0x00000000,0
|
subu $sp,$sp,24
|
subu $sp,$sp,24
|
sw $ra,16($sp)
|
sw $ra,16($sp)
|
lui $a0,%hi(.LC2) # high
|
lui $a0,%hi(.LC2) # high
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
jal print_uart
|
jal print_uart
|
addiu $a0,$a0,%lo(.LC2) # low
|
addiu $a0,$a0,%lo(.LC2) # low
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
move $v0,$zero
|
move $v0,$zero
|
lw $ra,16($sp)
|
lw $ra,16($sp)
|
.set noreorder
|
.set noreorder
|
.set nomacro
|
.set nomacro
|
j $ra
|
j $ra
|
addu $sp,$sp,24
|
addu $sp,$sp,24
|
.set macro
|
.set macro
|
.set reorder
|
.set reorder
|
|
|
.end parse_error
|
.end parse_error
|
.size parse_error,.-parse_error
|
.size parse_error,.-parse_error
|
|
|