From 6791d6b7bbb86db374f4cbe80b0cb44cd534e533 Mon Sep 17 00:00:00 2001 From: unlockable Date: Thu, 11 Jul 2024 00:31:51 +0800 Subject: [PATCH] Add test for bgtz --- 07test_bgtz.asm | 18 ++++++++++++++++++ 07test_bgtz.txt | 16 ++++++++++++++++ 07test_bgtz_mars.txt | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 07test_bgtz.asm create mode 100644 07test_bgtz.txt create mode 100644 07test_bgtz_mars.txt diff --git a/07test_bgtz.asm b/07test_bgtz.asm new file mode 100644 index 0000000..7a680fc --- /dev/null +++ b/07test_bgtz.asm @@ -0,0 +1,18 @@ + addi $s1, $zero, 2 + nop + nop + nop + nop +start: + addi $s1, $s1, -1 + nop + nop + nop + nop + bgtz $s1, start + nop + nop + nop + nop +end: + j end \ No newline at end of file diff --git a/07test_bgtz.txt b/07test_bgtz.txt new file mode 100644 index 0000000..6eff177 --- /dev/null +++ b/07test_bgtz.txt @@ -0,0 +1,16 @@ +20'd0: instruction <= 32'h20110002; // addi $s1, $zero, 2 +20'd1: instruction <= 32'h00000000; +20'd2: instruction <= 32'h00000000; +20'd3: instruction <= 32'h00000000; +20'd4: instruction <= 32'h00000000; // start: +20'd5: instruction <= 32'h2231ffff; // addi $s1, $s1, -1 +20'd6: instruction <= 32'h00000000; +20'd7: instruction <= 32'h00000000; +20'd8: instruction <= 32'h00000000; +20'd9: instruction <= 32'h00000000; +20'd10: instruction <= 32'h1e20fffa; // bgtz $s1, start +20'd11: instruction <= 32'h00000000; +20'd12: instruction <= 32'h00000000; +20'd13: instruction <= 32'h00000000; +20'd14: instruction <= 32'h00000000; // end: +20'd15: instruction <= 32'h0800000f; // j end \ No newline at end of file diff --git a/07test_bgtz_mars.txt b/07test_bgtz_mars.txt new file mode 100644 index 0000000..724ae61 --- /dev/null +++ b/07test_bgtz_mars.txt @@ -0,0 +1,16 @@ +20110002 +00000000 +00000000 +00000000 +00000000 +2231ffff +00000000 +00000000 +00000000 +00000000 +1e20fffa +00000000 +00000000 +00000000 +00000000 +0800000f