diff --git a/test_asm/fibonacci.asm b/test_asm/fibonacci.asm new file mode 100644 index 0000000..107f478 --- /dev/null +++ b/test_asm/fibonacci.asm @@ -0,0 +1,21 @@ +:DUMP DEBUG0 +:RUN + +addi $s0 $zero 100 +addi $s1 $zero 0 +addi $s2 $zero 1 +addi $s3 $zero 0 + +:LABEL LOOP +add $s3 $s1 $s2 + +add $s1 $s2 $zero +add $s2 $s3 $zero + +slt $t0 $s3 $s0 +beq $t0 $zero EXIT + +:REGCAT $s3 +j LOOP + +:LABEL EXIT diff --git a/test_asm/input_loop.asm b/test_asm/input_loop.asm new file mode 100644 index 0000000..3060370 --- /dev/null +++ b/test_asm/input_loop.asm @@ -0,0 +1,13 @@ +:DUMP DEBUG0 +:RUN + +addi $s0 $zero 33 + +:LABEL LOOP +:INPUT $s1 +:OUTPUT $s1 +:CRLF +beq $s0 $s1 EXIT +j LOOP +:LABEL EXIT +:REGCAT $pc diff --git a/test_asm/test.asm b/test_asm/test.asm index eb93e80..107f478 100644 --- a/test_asm/test.asm +++ b/test_asm/test.asm @@ -1,13 +1,21 @@ :DUMP DEBUG0 :RUN -addi $s0 $s0 33 +addi $s0 $zero 100 +addi $s1 $zero 0 +addi $s2 $zero 1 +addi $s3 $zero 0 :LABEL LOOP -:INPUT $s1 -:OUTPUT $s1 -:CRLF -beq $s0 $s1 EXIT +add $s3 $s1 $s2 + +add $s1 $s2 $zero +add $s2 $s3 $zero + +slt $t0 $s3 $s0 +beq $t0 $zero EXIT + +:REGCAT $s3 j LOOP + :LABEL EXIT -:REGCAT $pc