MIPS32指令集(多來源_格式整齊)_第1頁
MIPS32指令集(多來源_格式整齊)_第2頁
MIPS32指令集(多來源_格式整齊)_第3頁
MIPS32指令集(多來源_格式整齊)_第4頁
MIPS32指令集(多來源_格式整齊)_第5頁
已閱讀5頁,還剩2頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、MIPS32指令集MIPS指令可以分成以下各類:空操作no-op;寄存器寄存器傳輸:用得很廣,包括條件傳輸在內(nèi);常數(shù)加載:作為數(shù)值和地址的整型立即數(shù);算術(shù)邏輯指令;整數(shù)乘法、除法和求余數(shù);整數(shù)乘加;加載和存儲;跳轉(zhuǎn)、子程序調(diào)用和分支;斷點和自陷;CP0功能:CPU控制指令浮點;用戶態(tài)的受限訪問:rdhwr和synci注:64位版本開頭以“d”表示,無符號數(shù)以“u”結(jié)尾,立即數(shù)通常以“i”結(jié)尾,字節(jié)操作以“b”結(jié)尾,雙字操作以“d”結(jié)尾,字操作以“w”結(jié)尾1、空操作:nop:相當(dāng)于sllzero,zero,o,ssnop:equalssllzero,zero,1.這個指令不得與其它指令同時發(fā)送,

2、這樣就保證了其運行要花費至少一個時鐘周期。這在簡單的流水線的CPU上無關(guān)緊要,但在復(fù)雜些的實現(xiàn)上對于實現(xiàn)強制的延時很有用。2、寄存器寄存器傳送:move:通常用跟$zero寄存器的or來實現(xiàn),或者用addu。movf,movt,movn,movz:條件傳送。3、常數(shù)加載:dla、la:用來加載程序中某些帶標(biāo)號的位置或者變量的地址的宏指令;dli、li:裝入立即數(shù)常數(shù),這是一個宏指令;lui:把立即數(shù)加載到寄存器高位。4、算術(shù)邏輯運算:add、addi、dadd、daddi、addu、addiu、daddu、daddiu、dsub、sub、subu:加法扌旨令和減法指令;abs,dabs:絕對值

3、;dneg、neg、negu:取相反數(shù);and、andi、or、ori、xor、nor:逐位邏輯操作指令;drol、rol、ror:循環(huán)移位指令;sll、srl、sra:移位。5、條件設(shè)置指令:sit、slti、sltiu、situ、seq、sge、sle、sne:條件設(shè)置。6、整數(shù)乘法、除法和求余數(shù):div、mul、rem等等。7、整數(shù)乘加(累加)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匯編指令A(yù)rithmeticInstructionsabsdes,srcl#desgetstheabsolutevalueofsrcl.add(u)des,src1,src2#desgetssrc1+src2.addi$t2,$t3,5#$t2=$t3+5加16位立即數(shù)addiu$t2,$t3,5#$t2=$t3+5加16位無符號立即數(shù)sub(u)des,src1,src2#desgetssrc1-src2.div(u)src1,reg2#Dividesrc1byreg2,leavingthequotientin

6、registerloandtheremainderinregisterhi.div(u)des,src1,src2#desgetssrc1/src2.muldes,src1,src2#desgetssrc1*src2.mulodes,srcl,src2#desgetssrcl*src2,withoverflow.mult(u)srcl,reg2#Multiplysrclandreg2,leavingthelow-orderwordinregisterloandthehigh-orderwordinregisterhi.rem(u)des,srcl,src2#desgetstheremainde

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

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

9、iftlogical.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,0oth

10、erwise.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#Brancht

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

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

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

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

15、rsrc1toaddr.swsrc1,addr#Storethewordinregistersrc1toaddr.swlsrc1,addr#Storetheupperhalfwordinsrctothe(possiblyunaligned)addressaddr.swrsrc1,addr#Storethelowerhalfwordinsrctothe(possiblyunaligned)addressaddr.ushsrc1,addr#Storethelowerhalfwordinsrctothe(possiblyunaligned)addressaddr.uswsrc1,addr#Storethewordinsrctothe(possiblyunaligned)addressaddr.movedes,src1#Copythecontentsofsrc1todes.mfhides#Copythecontentsofthehiregistertodes.mflodes#Copythecontentsoftheloregistertodes.mthisrc1#Copythecontentsoft

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論