✨
This commit is contained in:
221
tests/negate.asm
221
tests/negate.asm
@ -1,6 +1,30 @@
|
||||
.text 0x00400000
|
||||
.globl main
|
||||
la $28, _heap_
|
||||
la $4, _a__str__39_
|
||||
# was: la _a__str__39__addr, _a__str__39_
|
||||
ori $3, $0, 1
|
||||
# was: ori _a__str__39__init, $0, 1
|
||||
sw $3, 0($4)
|
||||
# was: sw _a__str__39__init, 0(_a__str__39__addr)
|
||||
la $4, _a__str__29_
|
||||
# was: la _a__str__29__addr, _a__str__29_
|
||||
ori $3, $0, 1
|
||||
# was: ori _a__str__29__init, $0, 1
|
||||
sw $3, 0($4)
|
||||
# was: sw _a__str__29__init, 0(_a__str__29__addr)
|
||||
la $4, _a__str__22_
|
||||
# was: la _a__str__22__addr, _a__str__22_
|
||||
ori $3, $0, 1
|
||||
# was: ori _a__str__22__init, $0, 1
|
||||
sw $3, 0($4)
|
||||
# was: sw _a__str__22__init, 0(_a__str__22__addr)
|
||||
la $4, _a__str__15_
|
||||
# was: la _a__str__15__addr, _a__str__15_
|
||||
ori $3, $0, 1
|
||||
# was: ori _a__str__15__init, $0, 1
|
||||
sw $3, 0($4)
|
||||
# was: sw _a__str__15__init, 0(_a__str__15__addr)
|
||||
la $4, _a__str__8_
|
||||
# was: la _a__str__8__addr, _a__str__8_
|
||||
ori $3, $0, 1
|
||||
@ -23,18 +47,21 @@
|
||||
_stop_:
|
||||
ori $2, $0, 10
|
||||
syscall
|
||||
# Function write_nl
|
||||
write_nl:
|
||||
# Function main
|
||||
main:
|
||||
sw $31, -4($29)
|
||||
sw $20, -24($29)
|
||||
sw $19, -20($29)
|
||||
sw $18, -16($29)
|
||||
sw $17, -12($29)
|
||||
sw $16, -8($29)
|
||||
addi $29, $29, -12
|
||||
# ori _param_b_1_,$2,0
|
||||
ori $16, $2, 0
|
||||
# was: ori _tmp_4_, _param_b_1_, 0
|
||||
addi $29, $29, -28
|
||||
ori $17, $0, 1
|
||||
# was: ori _tmp_4_, $0, 1
|
||||
# ori _letBind_3_,_tmp_4_,0
|
||||
la $2, _true
|
||||
# was: la $2, _true
|
||||
bne $16, $0, _wBoolF_5_
|
||||
bne $17, $0, _wBoolF_5_
|
||||
# was: bne _letBind_3_, $0, _wBoolF_5_
|
||||
la $2, _false
|
||||
# was: la $2, _false
|
||||
@ -47,72 +74,108 @@ _wBoolF_5_:
|
||||
# ori _letBind_6_,_tmp_7_,0
|
||||
# ori $2,_tmp_7_,0
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
# ori _letBind_2_,_letBind_3_,0
|
||||
ori $18, $0, 0
|
||||
# was: ori _tmp_11_, $0, 0
|
||||
# ori _letBind_10_,_tmp_11_,0
|
||||
la $2, _true
|
||||
# was: la $2, _true
|
||||
bne $18, $0, _wBoolF_12_
|
||||
# was: bne _letBind_10_, $0, _wBoolF_12_
|
||||
la $2, _false
|
||||
# was: la $2, _false
|
||||
_wBoolF_12_:
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
la $2, _a__str__15_
|
||||
# was: la _tmp_14_, _a__str__15_
|
||||
# _a__str__15_: string "\n"
|
||||
# ori _letBind_13_,_tmp_14_,0
|
||||
# ori $2,_tmp_14_,0
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
# ori _letBind_9_,_letBind_10_,0
|
||||
ori $19, $0, 0
|
||||
# was: ori _tmp_18_, $0, 0
|
||||
# ori _letBind_17_,_tmp_18_,0
|
||||
la $2, _true
|
||||
# was: la $2, _true
|
||||
bne $19, $0, _wBoolF_19_
|
||||
# was: bne _letBind_17_, $0, _wBoolF_19_
|
||||
la $2, _false
|
||||
# was: la $2, _false
|
||||
_wBoolF_19_:
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
la $2, _a__str__22_
|
||||
# was: la _tmp_21_, _a__str__22_
|
||||
# _a__str__22_: string "\n"
|
||||
# ori _letBind_20_,_tmp_21_,0
|
||||
# ori $2,_tmp_21_,0
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
# ori _letBind_16_,_letBind_17_,0
|
||||
ori $20, $0, 1
|
||||
# was: ori _tmp_25_, $0, 1
|
||||
# ori _letBind_24_,_tmp_25_,0
|
||||
la $2, _true
|
||||
# was: la $2, _true
|
||||
bne $20, $0, _wBoolF_26_
|
||||
# was: bne _letBind_24_, $0, _wBoolF_26_
|
||||
la $2, _false
|
||||
# was: la $2, _false
|
||||
_wBoolF_26_:
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
la $2, _a__str__29_
|
||||
# was: la _tmp_28_, _a__str__29_
|
||||
# _a__str__29_: string "\n"
|
||||
# ori _letBind_27_,_tmp_28_,0
|
||||
# ori $2,_tmp_28_,0
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
# ori _letBind_23_,_letBind_24_,0
|
||||
# ori _letBind_30_,_letBind_2_,0
|
||||
beq $17, $16, _false_33_
|
||||
# was: beq _letBind_30_, 0, _false_33_
|
||||
ori $17, $18, 0
|
||||
# was: ori _letBind_30_, _letBind_9_, 0
|
||||
_false_33_:
|
||||
beq $17, $16, _false_32_
|
||||
# was: beq _letBind_30_, 0, _false_32_
|
||||
ori $17, $19, 0
|
||||
# was: ori _letBind_30_, _letBind_16_, 0
|
||||
_false_32_:
|
||||
beq $17, $16, _false_31_
|
||||
# was: beq _letBind_30_, 0, _false_31_
|
||||
ori $17, $20, 0
|
||||
# was: ori _letBind_30_, _letBind_23_, 0
|
||||
_false_31_:
|
||||
ori $16, $17, 0
|
||||
# was: ori _tmp_35_, _letBind_30_, 0
|
||||
# ori _letBind_34_,_tmp_35_,0
|
||||
la $2, _true
|
||||
# was: la $2, _true
|
||||
bne $16, $0, _wBoolF_36_
|
||||
# was: bne _letBind_34_, $0, _wBoolF_36_
|
||||
la $2, _false
|
||||
# was: la $2, _false
|
||||
_wBoolF_36_:
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
la $2, _a__str__39_
|
||||
# was: la _tmp_38_, _a__str__39_
|
||||
# _a__str__39_: string "\n"
|
||||
# ori _letBind_37_,_tmp_38_,0
|
||||
# ori $2,_tmp_38_,0
|
||||
jal putstring
|
||||
# was: jal putstring, $2
|
||||
ori $2, $16, 0
|
||||
# was: ori _write_nlres_2_, _letBind_3_, 0
|
||||
# ori $2,_write_nlres_2_,0
|
||||
addi $29, $29, 12
|
||||
lw $16, -8($29)
|
||||
lw $31, -4($29)
|
||||
jr $31
|
||||
# Function main
|
||||
main:
|
||||
sw $31, -4($29)
|
||||
sw $19, -20($29)
|
||||
sw $18, -16($29)
|
||||
sw $17, -12($29)
|
||||
sw $16, -8($29)
|
||||
addi $29, $29, -24
|
||||
ori $2, $0, 1
|
||||
# was: ori _arg_11_, $0, 1
|
||||
# ori $2,_arg_11_,0
|
||||
jal write_nl
|
||||
# was: jal write_nl, $2
|
||||
ori $18, $2, 0
|
||||
# was: ori _letBind_10_, $2, 0
|
||||
ori $2, $0, 0
|
||||
# was: ori _arg_13_, $0, 0
|
||||
# ori $2,_arg_13_,0
|
||||
jal write_nl
|
||||
# was: jal write_nl, $2
|
||||
ori $16, $2, 0
|
||||
# was: ori _letBind_12_, $2, 0
|
||||
ori $2, $0, 0
|
||||
# was: ori _arg_15_, $0, 0
|
||||
# ori $2,_arg_15_,0
|
||||
jal write_nl
|
||||
# was: jal write_nl, $2
|
||||
ori $17, $2, 0
|
||||
# was: ori _letBind_14_, $2, 0
|
||||
ori $2, $0, 1
|
||||
# was: ori _arg_17_, $0, 1
|
||||
# ori $2,_arg_17_,0
|
||||
jal write_nl
|
||||
# was: jal write_nl, $2
|
||||
# ori _letBind_16_,$2,0
|
||||
# ori _arg_18_,_letBind_10_,0
|
||||
beq $18, $19, _false_21_
|
||||
# was: beq _arg_18_, 0, _false_21_
|
||||
ori $18, $16, 0
|
||||
# was: ori _arg_18_, _letBind_12_, 0
|
||||
_false_21_:
|
||||
beq $18, $19, _false_20_
|
||||
# was: beq _arg_18_, 0, _false_20_
|
||||
ori $18, $17, 0
|
||||
# was: ori _arg_18_, _letBind_14_, 0
|
||||
_false_20_:
|
||||
beq $18, $19, _false_19_
|
||||
# was: beq _arg_18_, 0, _false_19_
|
||||
ori $18, $2, 0
|
||||
# was: ori _arg_18_, _letBind_16_, 0
|
||||
_false_19_:
|
||||
ori $2, $18, 0
|
||||
# was: ori $2, _arg_18_, 0
|
||||
jal write_nl
|
||||
# was: jal write_nl, $2
|
||||
# ori _mainres_9_,$2,0
|
||||
# ori $2,_mainres_9_,0
|
||||
addi $29, $29, 24
|
||||
# was: ori _mainres_1_, _letBind_34_, 0
|
||||
# ori $2,_mainres_1_,0
|
||||
addi $29, $29, 28
|
||||
lw $20, -24($29)
|
||||
lw $19, -20($29)
|
||||
lw $18, -16($29)
|
||||
lw $17, -12($29)
|
||||
@ -231,6 +294,22 @@ _Msg_DivZero_:
|
||||
.asciiz "division by zero"
|
||||
# String Literals
|
||||
.align 2
|
||||
_a__str__39_:
|
||||
.space 4
|
||||
.asciiz "\n"
|
||||
.align 2
|
||||
_a__str__29_:
|
||||
.space 4
|
||||
.asciiz "\n"
|
||||
.align 2
|
||||
_a__str__22_:
|
||||
.space 4
|
||||
.asciiz "\n"
|
||||
.align 2
|
||||
_a__str__15_:
|
||||
.space 4
|
||||
.asciiz "\n"
|
||||
.align 2
|
||||
_a__str__8_:
|
||||
.space 4
|
||||
.asciiz "\n"
|
||||
|
Reference in New Issue
Block a user