This commit is contained in:
unlockable
2024-07-10 23:56:28 +08:00
parent 6f1d6eb955
commit acfae7a597
3 changed files with 62 additions and 0 deletions

44
04test_beq.asm Normal file
View File

@@ -0,0 +1,44 @@
addi $s1, $zero, 1
nop
nop
nop
nop
addi $s2, $zero, 1
nop
nop
nop
nop
beq $s1, $s2, beq_target
nop
nop
nop
nop
addi $s3, $zero, 1
nop
nop
nop
nop
beq_target:
addi $s1, $s1, 1
nop
nop
nop
nop
beq $s1, $s2, beq_target2
nop
nop
nop
nop
addi $s3, $zero, 3
nop
nop
nop
nop
beq_target2:
j beq_target2
nop
nop
nop
nop

10
04test_beq.txt Normal file
View File

@@ -0,0 +1,10 @@
20'd0: instruction <= 32'h20110001; // addi $s1, $zero, 1
20'd6: instruction <= 32'h20120001; // addi $s2, $zero, 1
20'd11: instruction <= 32'h12320009; // beq $s1, $s2, beq_target
20'd16: instruction <= 32'h20130001; // addi $s3, $zero, 1
// beq_target:
20'd21: instruction <= 32'h22310001; // addi $s1, $s1, 1
20'd26: instruction <= 32'h12320009; // beq $s1, $s2, beq_target2
20'd31: instruction <= 32'h20130003; // addi $s3, $zero, 3
// beq_target2:
20'd36: instruction <= 32'h08100023; // j beq_target2

8
04test_beq_mars.txt Normal file
View File

@@ -0,0 +1,8 @@
20110001
20120001
12320009
20130001
22310001
12320009
20130003
08100023