MIPS32指令集(多来源_格式整齐)

上传人:小** 文档编号:112105918 上传时间:2022-06-22 格式:DOC 页数:5 大小:490.50KB
收藏 版权申诉 举报 下载
MIPS32指令集(多来源_格式整齐)_第1页
第1页 / 共5页
MIPS32指令集(多来源_格式整齐)_第2页
第2页 / 共5页
MIPS32指令集(多来源_格式整齐)_第3页
第3页 / 共5页
资源描述:

《MIPS32指令集(多来源_格式整齐)》由会员分享,可在线阅读,更多相关《MIPS32指令集(多来源_格式整齐)(5页珍藏版)》请在装配图网上搜索。

1、MIPS32指令集MIPS指令可以分成以下各类:空操作no-op;寄存器寄存器传输:用得很广,包括条件传输在内;常数加载:作为数值和地址的整型立即数;算术逻辑指令;整数乘法、除法和求余数;整数乘加;加载和存储;跳转、子程序调用和分支;断点和自陷;CP0功能:CPU控制指令浮点;用户态的受限访问:rdhwr和synci注:64位版本开头以“d”表示,无符号数以“u”结尾,立即数通常以“i”结尾,字节操作以“b”结尾,双字操作以“d”结尾,字操作以“w”结尾1、空操作:nop:相当于sllzero,zero,o,ssnop:equalssllzero,zero,1.这个指令不得与其它指令同时发送,

2、这样就保证了其运行要花费至少一个时钟周期。这在简单的流水线的CPU上无关紧要,但在复杂些的实现上对于实现强制的延时很有用。2、寄存器寄存器传送:move:通常用跟$zero寄存器的or来实现,或者用addu。movf,movt,movn,movz:条件传送。3、常数加载:dla、la:用来加载程序中某些带标号的位置或者变量的地址的宏指令;dli、li:装入立即数常数,这是一个宏指令;lui:把立即数加载到寄存器高位。4、算术逻辑运算:add、addi、dadd、daddi、addu、addiu、daddu、daddiu、dsub、sub、subu:加法扌旨令和减法指令;abs,dabs:绝对值

3、;dneg、neg、negu:取相反数;and、andi、or、ori、xor、nor:逐位逻辑操作指令;drol、rol、ror:循环移位指令;sll、srl、sra:移位。5、条件设置指令:sit、slti、sltiu、situ、seq、sge、sle、sne:条件设置。6、整数乘法、除法和求余数:div、mul、rem等等。7、整数乘加(累加)mad等。8、加载和存储:lb、ld、ldl、ldr、sdl、sdr、lh、lhu、ll、sc、pref、sb等操作。9、浮点加载和存储:l.d、l.s、s.d、s.s等常用MIPS指令集及格式:0000srl000000rt0rdsham0000

4、10000sra000000rt0rdsham00001sllv000000rsrtrd000000010srlv000000rsrtrd000000011srav000000rsrtrd00000001100jr000000rs0000000000000100I-typoprsertimmediateaddi001000rsrtimmediateaddiu001001rsrtimmediateandi001100rsrtimmediateori001101rsrtimmediatexori001110rsrtimmediatelui0000001111rtimmediate0lw100011

5、rsrtimmediatesw101011rsrtimmediate更全的MIPS汇编指令ArithmeticInstructionsabsdes,srcl#desgetstheabsolutevalueofsrcl.add(u)des,src1,src2#desgetssrc1+src2.addi$t2,$t3,5#$t2=$t3+5加16位立即数addiu$t2,$t3,5#$t2=$t3+5加16位无符号立即数sub(u)des,src1,src2#desgetssrc1-src2.div(u)src1,reg2#Dividesrc1byreg2,leavingthequotientin

6、register# loandtheremainderinregisterhi.div(u)des,src1,src2#desgetssrc1/src2.muldes,src1,src2#desgetssrc1*src2.mulodes,srcl,src2#desgetssrcl*src2,withoverflow.mult(u)srcl,reg2#Multiplysrclandreg2,leavingthelow-orderword# inregisterloandthehigh-orderwordinregisterhi.rem(u)des,srcl,src2#desgetstherema

7、inderofdividingsrclbysrc2.neg(u)des,srcl#desgetsthenegativeofsrcl.anddes,srcl,src2#desgetsthebitwiseandofsrclandsrc2.nordes,srcl,src2#desgetsthebitwiselogicalnorofsrclandsrc2.notdes,srcl#desgetsthebitwiselogicalnegationofsrcl.ordes,srcl,src2#desgetsthebitwiselogicalorofsrclandsrc2.xordes,srcl,src2#d

8、esgetsthebitwiseexclusiveorofsrclandsrc2.roldes,srcl,src2#desgetstheresultofrotatingleftthecontentsofsrclbysrc2bits.rordes,srcl,src2#desgetstheresultofrotatingrightthecontentsofsrclbysrc2bits.slldes,srcl,src2#desgetssrclshiftedleftbysrc2bits.srades,srcl,src2#Rightshiftarithmetic.srldes,srcl,src2#Rig

9、htshiftlogical.sllvdes,srcl,src2#$t0=$t1$t3,shiftrightlogicalsravdes,srcl,src2#$t0=$t1$t3,shiftrightarithm.ComparisonInstructionsseqdes,src1,src2#des1ifsrc1=src2,0otherwise.snedes,src1,src2#des1ifsrc1!=src2,0otherwise.sge(u)des,src1,src2#des1ifsrc1=src2,0otherwise.sgt(u)des,src1,src2#des1ifsrc1src2,

10、0otherwise.sle(u)des,src1,src2#des1ifsrc1=src2,0otherwise.slt(u)des,src1,src2#des1ifsrc1=src2.bgt(u)src1,src2,lab#Branchtolabifsrc1src2.ble(u)src1,src2,lab#Branchtolabifsrc1=src2.blt(u)src1,src2,lab#Branchtolabifsrc1=0.bgtzsrc1,lab#Branchtolabifsrc10.blezsrc1,lab#Branchtolabifsrc1=0.bltzsrc1,lab#Bra

11、nchtolabifsrc1=0,thenputtheaddressofthenextinstruction#into$raandbranchtolab.bgtzalsrc1,lab#Ifsrc10,thenputtheaddressofthenextinstruction#into$raandbranchtolab.bltzalsrc1,lab#Ifsrc10,thenputtheaddressofthenextinstruction#into$raandbranchtolab.jlabel#Jumptolabellab.jrsrc1#Jumptolocationsrc1.jallabel#

12、Jumptolabellab,andstoretheaddressofthenextinstructionin$ra.jalrsrc1#Jumptolocationsrc1,andstoretheaddressofthenextinstructionin$ra.Load,Store,andDataMovement(reg)$Contentsofreg.const$Aconstantaddress.const(reg)$const+contentsofreg.symbol$Theaddressofsymbol.symbol+const$Theaddressofsymbol+const.symbo

13、l+const(reg)$Theaddressofsymbol+const+contentsofreg.lades,addr#Loadtheaddressofalabel.lb(u)des,addr#Loadthebyteataddrintodes.lh(u)des,addr#Loadthehalfwordataddrintodes.lides,const#Loadtheconstantconstintodes.luides,const#Loadtheconstantconstintotheupperhalfwordofdes,#andsetthelowerhalfwordofdesto0.l

14、wdes,addr#Loadthewordataddrintodes.lwldes,addrlwrdes,addrulh(u)des,addr#Loadthehalfwordstartingatthe(possiblyunaligned)addressaddrintodes.ulwdes,addr#Loadthewordstartingatthe(possiblyunaligned)addressaddrintodes.sbsrc1,addr#Storethelowerbyteofregistersrc1toaddr.shsrc1,addr#Storethelowerhalfwordofreg

15、istersrc1toaddr.swsrc1,addr#Storethewordinregistersrc1toaddr.swlsrc1,addr#Storetheupperhalfwordinsrctothe(possiblyunaligned)addressaddr.swrsrc1,addr#Storethelowerhalfwordinsrctothe(possiblyunaligned)addressaddr.ushsrc1,addr#Storethelowerhalfwordinsrctothe(possiblyunaligned)addressaddr.uswsrc1,addr#S

16、torethewordinsrctothe(possiblyunaligned)addressaddr.movedes,src1#Copythecontentsofsrc1todes.mfhides#Copythecontentsofthehiregistertodes.mflodes#Copythecontentsoftheloregistertodes.mthisrc1#Copythecontentsofthesrc1tohi.mtlosrc1#Copythecontentsofthesrc1tolo.ExceptionHandlingrfe#Returnfromexception.syscall#Makesasystemcall.See4.6.1foralistoftheSPIMsystemcalls.breakconst#Usedbythedebugger.nop#Aninstructionwhichhasnoeffect(otherthantakingacycletoexecute).

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!