Test jal and jr
This commit is contained in:
17
09test_jal_jr.asm
Normal file
17
09test_jal_jr.asm
Normal file
@@ -0,0 +1,17 @@
|
||||
main:
|
||||
addi $s1, $zero, 1
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
jal func
|
||||
end:
|
||||
j end
|
||||
|
||||
func:
|
||||
addi $s2, $zero, 2
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
jr $ra
|
||||
15
09test_jal_jr.txt
Normal file
15
09test_jal_jr.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
20'd0: instruction <= 32'h20110001; // addi $s1, $zero, 1
|
||||
20'd1: instruction <= 32'h00000000;
|
||||
20'd2: instruction <= 32'h00000000;
|
||||
20'd3: instruction <= 32'h00000000;
|
||||
20'd4: instruction <= 32'h00000000;
|
||||
20'd5: instruction <= 32'h0c000007; // jal func
|
||||
// end:
|
||||
20'd6: instruction <= 32'h08000006; // j end
|
||||
// func:
|
||||
20'd7: instruction <= 32'h20120002; // addi $s2, $zero, 2
|
||||
20'd8: instruction <= 32'h00000000;
|
||||
20'd9: instruction <= 32'h00000000;
|
||||
20'd10: instruction <= 32'h00000000;
|
||||
20'd11: instruction <= 32'h00000000;
|
||||
20'd12: instruction <= 32'h03e00008; // jr $ra
|
||||
13
09test_jal_jr_mars.txt
Normal file
13
09test_jal_jr_mars.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
20110001
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
0c000007
|
||||
08000006
|
||||
20120002
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
03e00008
|
||||
Reference in New Issue
Block a user