diff --git a/10test_jalr.asm b/10test_jalr.asm new file mode 100644 index 0000000..131eb59 --- /dev/null +++ b/10test_jalr.asm @@ -0,0 +1,21 @@ + addi $s1, $zero, 2 + nop + nop + nop + nop + addi $s2, $zero, 0x50 + nop + nop + nop + nop + jalr $s0, $s2 +end: + j end + +func: + addi $s3, $zero, 3 + nop + nop + nop + nop + jr $s0 diff --git a/10test_jalr.txt b/10test_jalr.txt new file mode 100644 index 0000000..7cc792c --- /dev/null +++ b/10test_jalr.txt @@ -0,0 +1,20 @@ +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; +20'd5: instruction <= 32'h20120050; // addi $s2, $zero, 0x50 +20'd6: instruction <= 32'h00000000; +20'd7: instruction <= 32'h00000000; +20'd8: instruction <= 32'h00000000; +20'd9: instruction <= 32'h00000000; +20'd10: instruction <= 32'h02408009; // jalr $s2, $s0 + // end: +20'd11: instruction <= 32'h0800000b; // j end + // Note the address +20'd20: instruction <= 32'h20130003; // addi $s3, $zero, 3 +20'd21: instruction <= 32'h00000000; +20'd22: instruction <= 32'h00000000; +20'd23: instruction <= 32'h00000000; +20'd24: instruction <= 32'h00000000; +20'd25: instruction <= 32'h02000008; // jr $s0 \ No newline at end of file diff --git a/10test_jalr_mars.txt b/10test_jalr_mars.txt new file mode 100644 index 0000000..e09f689 --- /dev/null +++ b/10test_jalr_mars.txt @@ -0,0 +1,18 @@ +20110002 +00000000 +00000000 +00000000 +00000000 +20120050 +00000000 +00000000 +00000000 +00000000 +02408009 +0800000b +20130003 +00000000 +00000000 +00000000 +00000000 +02000008