Mips汇编程序中执行的指令总数(指令计数器与指令统计)

时间:2019-03-27 19:40:01

标签: assembly count mips instructions

要检查在MIPS中执行的指令数,据我所知有两个选项。在工具中有: 1)指令计数器 2)指令统计

当我在程序上运行这些工具时,得到的结果不是1。即 示例代码为:

.data

.text
 addiu $t0, $zero, 0
 addiu $t1, $zero, 0
 addiu $t2, $zero, 100

 loop:
    bge $t1, $t2, loop_end
    bge $t1, 0x40, loop_end

andi $t3, $t1, 1    
addiu $t1, $t1, 1
j loop

loop_end:
xor $t0, $t3, $t3

使用方法1)我得到: enter image description here

方法2:

enter image description here

任何人都知道这种区别是从哪里来的,我应该把哪个作为正确答案?

0 个答案:

没有答案