当前位置:   article > 正文

MIPS指令编码

mips指令操作码编码

MIPS的指令都是32bit,被分为三类:

  1. Immediate: I-Type

    Filed 31:26 : opcode 6bit

    Filed 25:21 : rs 5bit

    Filed 20:16 : rt 5bit

    Filed 15:0 : immediate 16bit

  2. Jump: J-Type

    Filed 31:26 : opcode 6bit

    Filed 25:0 : instr_index 26bit

  3. Register: R-Type

    Filed 31:26 : opcode 6bit

    Filed 25:21 : rs 5bit

    Filed 20:16 : rt 5bit

    Filed 15:11 : rd 5bit

    Filed 10:6 :sa 5bit

    Filed 5:0 : function 6bit

opcode: primary oprtation code 操作码

rd: destination register 目的寄存器

rs: source register 源寄存器

rt:target(src/dst) register 目标寄存器,或者是给特殊功能用(REGIMM)

immediate: 立即数16bit, 用于逻辑,算数运算,load/stare的偏移地址和分支

instr_index: jump target address 跳转的目标地址,实际值右移动2位(指令4字节对齐),可以跳转28bit地址

sa:shift amount 位移量

function: 与opcode配合表示特殊的功能


转载于:https://my.oschina.net/lgl88911/blog/286633

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/272107
推荐阅读
相关标签
  

闽ICP备14008679号