From da570f3bb42ad72b91d5540a9a0b20f6c0f98dba Mon Sep 17 00:00:00 2001 From: unlockable Date: Thu, 11 Jul 2024 19:55:28 +0800 Subject: [PATCH] Try to use timer --- 15test_jal.asm | 19 +++++++++++++++++++ 15test_jal.txt | 14 ++++++++++++++ 15test_jal_mars.txt | 14 ++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 15test_jal.asm create mode 100644 15test_jal.txt create mode 100644 15test_jal_mars.txt diff --git a/15test_jal.asm b/15test_jal.asm new file mode 100644 index 0000000..cacd4df --- /dev/null +++ b/15test_jal.asm @@ -0,0 +1,19 @@ + lui $s0, 0x4000 + addi $s0, $s0, 0x10 +main_loop: + addi $s1, $zero, 0x15b + sw $s1, 0($s0) + jal wait_for_time + + addi $s1, $zero, 0x177 + sw $s1, 0($s0) + jal wait_for_time + j main_loop + +wait_for_time: + lui $t0, 0xf + addi $t0, $t0, 0x7fff +wait_loop: + addi $t0, $t0, -1 + bgtz $t0, wait_loop + jr $ra diff --git a/15test_jal.txt b/15test_jal.txt new file mode 100644 index 0000000..7987fbc --- /dev/null +++ b/15test_jal.txt @@ -0,0 +1,14 @@ +20'd0: instruction <= 32'h3c104000; +20'd1: instruction <= 32'h22100010; +20'd2: instruction <= 32'h2011015b; +20'd3: instruction <= 32'hae110000; +20'd4: instruction <= 32'h0c000009; +20'd5: instruction <= 32'h20110177; +20'd6: instruction <= 32'hae110000; +20'd7: instruction <= 32'h0c000009; +20'd8: instruction <= 32'h08000002; +20'd9: instruction <= 32'h3c08000f; +20'd10: instruction <= 32'h21087fff; +20'd11: instruction <= 32'h2108ffff; +20'd12: instruction <= 32'h1d00fffe; +20'd13: instruction <= 32'h03e00008; diff --git a/15test_jal_mars.txt b/15test_jal_mars.txt new file mode 100644 index 0000000..45680f8 --- /dev/null +++ b/15test_jal_mars.txt @@ -0,0 +1,14 @@ +3c104000 +22100010 +2011015b +ae110000 +0c000009 +20110177 +ae110000 +0c000009 +08000002 +3c08000f +21087fff +2108ffff +1d00fffe +03e00008