PIXNET Logo登入

Iver's Blog

跳到主文

想到就記錄

部落格全站分類:生活綜合

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 13 週二 201010:25
  • MIPS筆記



kseg1是不需要映射(物理虚拟转换),没有被缓存的,也就是说只有kseg1的内存区域可以做引导的存储区(在这里放置引导用flash存储器).被cached区域必须等到MMU 的TLB被初始化后才可以使用的。
kuseg、kseg2是Mapped address,必需等到power on後,初始化TLB(),才能使用。
kseg0是unmapped的,但是是cache的,所以也得等到cache被初使化後才能使用。
(繼續閱讀...)
文章標籤

lver76 發表在 痞客邦 留言(0) 人氣(216)

  • 個人分類:MIPS
▲top
  • 7月 12 週一 201009:24
  • MIPS指令集

轉自:http://tw.myblog.yahoo.com/chimei-015/article?mid=846&prev=900&next=638&l=f&fid=18
MIPS INSTRUCTIONS, REGISTERS AND SYSTEM CALLS
1. INTEGER and GENERAL INSTRUCTIONS
Call Arg 1 Arg 2 Arg3 Description
* abs rd rs put the absolute value of rs into rd
add rd rs rt rd = rs + rt (with overflow)
addu rd rs rt rd = rs + rt (without overflow)
addi rt rs imm rt = rs + imm (with overflow)
addiu rt rs imm rt = rs + imm (without overflow)
and rd rs rt put rs AND rt into rd
* b label branch to label
beq rs rt label branch to label if (rs==rt)
* beqz rs label branch to label if (rs==0)
* bge rs rt label branch to label if (rs>=rt)
bgez rs label branch to label if (rs>=0)
bgt rs rt label branch to label if (rs>rt)
bgtz rs label branch to label if (rs>0)
ble rs rt label branch to label if (rs<=rt)
blez rs label branch to label if (rs<=0)
* blt rs rt label branch to label if (rs<rt)
bltz rs label branch to label if (rs<0)
bne rs rt label branch to label if (rs!=rt)
* bnez rs label branch to label if (rs!=0)
div rd rs rt rd = rs DIV rt
j label jump to label
jal label jump to label and save next instruction in rd
jalr [rd] rs jump to instruction at (rs), save next in rd
jr rs jump to instruction at (rs)
* la rd label load address of word at label into rd
lb rt address load byte at address into rt, sign xtnd
lbu rt address load byte at address into rt
* li rd number load number into rd
lui rt number upper halfword of rt = 16-bit number
lw rd address load the word at address into rd
lw rd offset(base) load word at addr offset+base into rd
* move rd rs move rs to rd
* mul rd rs rt rd = rs * rt
* neg rd rs rd = - rs
nop do nothing
nor rd rs rt rd = rs NOR rt
* not rd rs rs = bitwise logical negation of rd
or rd rs rt rd = rs OR rt
ori rt rs imm rt = rs OR imm
* rem rd rs rt rd = rs MOD rt
* rol(ror) rd rs rt rd = rs rotated left(right) by rt
sb rt address store byte in rt to address
* seq rd rs rt if (rs==rt) rd=1;else rd=0
* sge rd rs rt if (rs>=rt) rd=1;else rd=0
* sgt rd rs rt if (rs>rt) rd=1;else rd=0
* sle rd rs rt if (rs<=rt) rd=1;else rd=0
sll rd rt sa rd = rt shifted left by distance sa
slt rd rs rt if (rs<rt) rd=1;else rd=0
* sne rd rs rt if (rs!=rt) rd=1;else rd=0
sra rd rt sa rd = rt shifted right by sa, sign-extended
srl rd rt sa rd = rt shifted right by sa, 0-extended
sub rd rs rt rd = rs - rt
sw rt address store the word in rt to address
sw rt offset(base) store word in rt to addr offset+base
syscall do a system call depending on contents of $v0
xor rd rs rt rd = rs XOR rt
* Indicates a pseudoinstruction (assembler generates more than one
instruction to produce the same result) (a pseudoinstruction has no opcode)
----------------------------------------------------------------------------
2. FLOATING POINT INSTRUCTIONS
(single precision)
Call Arg 1 Arg 2 Arg3 Description
abs.s fd fs fd = absolute value of fs
add.s fd fs ft fd = fs + ft
bc1f label branch to label if float-flag is FALSE
bc1t label branch to label if float-flag is TRUE
c.eq.s fs ft if (fs==ft) then float-flag is TRUE, else its FALSE
c.le.s fs ft if (fs<=ft) then float-flag is TRUE,else its FALSE
c.lt.s fs ft if (fs<ft) then float-flag is TRUE, else its FALSE
cvt.s.w fd fs convert integer in fs to single-precision float in fd
cvt.w.s fd fs convert single-precisoin float in fs to integer in fd
div.s fd fs ft fd = fs / ft
l.s fd address load the single at address into fd
li.s fd number load the number fd
mov.s fd fs move single from fs to fd
mfc1 rd rs move integer rs to float rd
mtc1 rs rd move integer rs to float rd
mul.s fd fs ft fd = fs * ft
neg.s fd fs fd = - fs
s.s fd addresss store fd at in memory at address
sub.s fd fs ft fd = fs - ft
----------------------------------------------------------------------------
3a. CPU REGISTERS
Name Register Function
$a0 4 used to pass the first of four arguments
$a1 5 used to pass the second of four arguments
$a2 6 used to pass the third of four arguments
$a3 7 used to pass the fourth of four arguments
$at 1 reserved for the operating system
$fp 30 frame pointer.
$gp 28 global memory pointer
$k0 26 reserved for the operating system
$k1 27 reserved for the operating system
$ra 31 return address
$s0 16 callee-saved registers
$s1 17 callee-saved registers
$s2 18 callee-saved registers
$s3 19 callee-saved registers
$s4 20 callee-saved registers
$s5 21 callee-saved registers
$s6 22 callee-saved registers
$s7 23 callee-saved registers
$sp 29 stack pointer to the first free location
$t0 8 used to hold temporary variables
$t1 9 used to hold temporary variables
$t2 10 used to hold temporary variables
$t3 11 used to hold temporary variables
$t4 12 used to hold temporary variables
$t5 13 used to hold temporary variables
$t6 14 used to hold temporary variables
$t7 15 used to hold temporary variables
$t8 24 used to hold temporary variables
$t9 25 used to hold temporary variables
$v0 2 used to pass values to and from functions
$v1 3 used to pass values to and from functions
3b. FPU (CP1) REGISTERS
Name Register Function
$f0 (float) hold floating point type function results
$f2 (float) hold floating poitn type function results
$f4 (float) temporary register
$f6 (float) temporary register
$f8 (float) temporary register
$f10 (float) temporary register
$f12 (float) pass the first of two float arguments
$f14 (float) pass the second of two float arguments
$f16 (float) temporary register
$f18 (float) temporary register
$f20 (float) saved register
$f22 (float) saved register
$f24 (float) saved register
$f26 (float) saved register
$f28 (float) saved register
$f30 (float) saved register
3c. CP0 REGISTERS
Register Function
13 Cause
14 EPC (Exception Program Counter)
----------------------------------------------------------------------------
4. SYSTEM CALL INFORMATION
Call Code Event Arguments Result
(in $v0)
1 print int $a0 = integer $a0 is printed out
2 print float $f12 = float $f12 is printed out
4 print string $a0 = pointer to string string is printed out
5 read int $v0 holds integer read
6 read float $f0 holds float read
7 read double $f0 holds double read
8 read string $a0 = buffer,a1 = length string is read from console
9 sbrk $a0 = amount address of additional memory in $v0
10 exit program
11 print byte $a0 = byte byte is printed out
----------------------------------------------------------------------------
Originally due to Eric Gauthier
Modified and expanded by C. D. Cantrell
(繼續閱讀...)
文章標籤

lver76 發表在 痞客邦 留言(0) 人氣(2,792)

  • 個人分類:MIPS
▲top
1

個人資訊

lver76
暱稱:
lver76
分類:
生活綜合
好友:
累積中
地區:

文章搜尋

文章分類

toggle Life (4)
  • Health (1)
  • 碎碎念 (4)
  • 雜七雜八 (4)
  • 文章 (2)
toggle Image (3)
  • Wallpaper (0)
  • Beauty (0)
  • 風景圖 (1)
toggle Travel (5)
  • 國外旅行 (0)
  • 台灣 (4)
  • 大陸 (2)
  • Manual (1)
  • 美食 (1)
toggle Music (6)
  • 老歌 (4)
  • 歐美音樂 (45)
  • Musical (5)
  • JP_Koera (12)
  • 中文 (6)
  • 韓國 (1)
toggle Video (2)
  • Funny (2)
  • 摔角 (1)
toggle Finance (5)
  • 房地產 (4)
  • 金融商品 (2)
  • Creative (0)
  • 財經 (0)
  • 股市分析 (0)
toggle IT (12)
  • C (17)
  • Linux (22)
  • APM (1)
  • MySQL (1)
  • Development Tool (4)
  • Software (2)
  • Network (1)
  • Windows (0)
  • VB.Net (1)
  • C++ (2)
  • Video (2)
  • MIPS (2)
  • 未分類文章 (1)

熱門文章

  • (17,959)亞洲樂園
  • (11,014)C語言巨集定義技巧
  • (3,992)C/C++語言struct深層探索
  • (2,573)Pragma
  • (2,558)NTFS下用ghost備份
  • (2,104)volatile
  • (1,198)Install 嘸蝦米 on Fedora 5
  • (373)八達嶺長城
  • (111)解釋EOF
  • (27)印度服務生抓狂

最新文章

  • [轉貼]C/C++ 學習歷程分享
  • 中国香港真功夫武打明星
  • 費翔 - 吻别
  • 费翔 - 我們的幸福呢
  • 张琪 - 江山万里心
  • 月下對口
  • 水木年華 - 一生有你
  • C++ Debug 筆記
  • Bach - Cello Suite No.1 i-Prelude
  • 久石讓:送行者~禮儀師的樂章

最新留言

  • [25/07/13] 訪客 於文章「孫子兵法(原文加白話翻譯)...」留言:
    ✌️...
  • [24/05/20] 張龍鳳 於文章「孫子兵法(原文加白話翻譯)...」留言:
    商店奶奶說ㄧ次,金寧鄉惡魔、鄉公所惡妖(工廠懷孕、上班瓶孕)...
  • [23/04/27] OREO ROCK 於文章「孫子兵法(原文加白話翻譯)...」留言:
    很有幫助的文章&#128402;...
  • [23/04/18] chung 於文章「中国香港真功夫武打明星...」留言:
    為何Top 1 & Top 2 都是李小龍? 再細看 ...
  • [22/08/09] wenshu 於文章「孫子兵法(原文加白話翻譯)...」留言:
    感謝分享...
  • [22/04/14] 訪客 於文章「亞洲樂園...」留言:
    原本在搜尋引擎找出一堆 Blog 文章,不知哪幾篇值得花時間...
  • [21/12/25] 康藥本鋪 kmed.tw 於文章「孫子兵法(原文加白話翻譯)...」留言:
    康藥本鋪 https://kmed.tw 康藥本...
  • [21/12/17] 康藥本舖 kmed.tw 於文章「孫子兵法(原文加白話翻譯)...」留言:
    德國黑倍 https://kmed.tw/index.p...
  • [21/12/11] aksqfoooii 於文章「孫子兵法(原文加白話翻譯)...」留言:
    三體牛鞭 https://kmed.tw/ind...
  • [21/08/24] jwang0189 於文章「孫子兵法(原文加白話翻譯)...」留言:
    非常實用的文章,謝謝提供,已點廣告表示支持 https://...

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: