|
|
||
|
ÀÌÆäÀÌÁöÀÇ ÀúÀÛ±ÇÀº |
||
|
Á¦¸ñ: MIPS ¼Ò°³ |
ÀúÀÚ¿¡°Ô ÀÖ½À´Ï´Ù |
|
|
ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com) |
ÃÖ±Ù¼öÁ¤ÀÏ:2009-01-18 |
|
|
|
|
|
ÂüÁ¶:
MIPS Á¤º¸1: http://www.langens.eu/tim/ea/mips_en.php
MIPS Á¤º¸2: http://logos.cs.uic.edu/366/notes/index.html
¿î¿µÃ¼Á¦ °ÀÇÀÚ·á: http://www.cs.rochester.edu/u/sandhya/csc252/
MIPS ¾î¼Àºí¸®¾ð¾î: http://chortle.ccsu.edu/AssemblyTutorial/index.html#Appendix
±â¼ú¼Àû:
Çϵå¿þ¾î: (¾Æ¸¶Á¸ $38, ±³º¸ \47,000, ¹ø¿ª¼ \20,000)
http://www.amazon.com/Designing-Embedded-Hardware-John-Catsoulis/dp/0596007558/ref=pd_sim_b_1
ARM °³¹ßÀÚ °¡À̵å: (¾Æ¸¶Á¸ $63)
¸®´ª½º µð¹ÙÀ̽º µå¶óÀ̹ö: (¾Æ¸¶Á¸ $36)
MIPS ¶õ?
|
MIPS(Microprocessor without Interlocked Pipeline Stages)´Â RISC ÇÁ·Î¼¼¼¸¦ ±â¹ÝÀ¸·Î ÇÏ¿© ½ºÅÄÆ÷µå ´ëÇб³ÀÇ John L. Hennessy¿¡ ÀÇÇØ¼ ¹ßÇ¥µÇ¾ú´Ù. 1984³â¿¡ Hennessy´Â MIPS ÄÄÇ»ÅÍ ½Ã½ºÅÛÀ» °á¼ºÇÏ¿© R2000 À̶ó´Â ù¹øÂ° Á¦Ç°À» °³¹ßÇϰí, 1988³â¿¡´Â Á»´õ Çâ»óµÈ R3000À» ¹ßÇ¥ÇÑ´Ù. R2000°ú R3000Àº µÑ´Ù 32ºñÆ®·Î µðÀÚÀÎ µÇ¾úÀ¸¸ç, ÀÌÈÄ¿¡´Â 64ºñÆ® CPUÀÎ R4000À» ³»³õ´Â´Ù. ÇöÀç, MIPS ÄÄÇ»ÅÍ ½Ã½ºÅÛÀº °¡Àå Å« °í°´À̾ú´ø SGI(Silicon Graphics)¿¡ ÀÇÇØ¼ ÀμöµÇ¾î MIPS Å×Å©³î·¯Áö·Î »ç¸íÀÌ º¯°æµÇ¾ú´Ù. MIPS´Â 1970³â´ë ÈĹݿ¡ °³¹ßµÈ RISC(Reduced Instruction Set Computer) ÇÁ·Î¼¼¼¸¦ ±â¹ÝÀ¸·Î ÇÏ¿© ¸í·É¾î´Â ÁÙÀ̰í, ·¹Áö½ºÅ͵éÀ» ´õ ¸¹ÀÌ »ç¿ëÇÏ¿© load/store¿¡ ÀÇÇÑ ¸Þ¸ð¸® Á¢±ÙÀ» ÁÙ¿©¼ CISC(Complex Instruction Set Computer)¿¡ ºñÇØ¼ ºü¸£°Ô µ¿ÀÛÇÑ´Ù. MIPS´Â ÆÄÀÌÇÁ¶óÀÎ(Pipelines)À» »ç¿ëÇÏ¿© RISC¸¦ °³¼±ÇßÀ¸¸ç, ÆÄÀÌÇÁ¶óÀÎÀº ÇϳªÀÇ ¸í·ÉÀÌ ¼öÇàµÇ´Â µ¿¾È, load/store¸¦ ¿¬ÀÌ¾î¼ ¼öÇàÇϹǷΠÇÁ·Î¼¼¼ÀÇ ¼º´ÉÀ» ³ô¿©ÁØ´Ù. ÇöÀç MIPS´Â DVD Ç÷¹À̾î, ³×Æ®¿öÅ© Àåºñ, ÈÞ´ë¿ë ±â±â, ÈÞ´ë¿ë ºñµð¿À °ÔÀÓ±âµîÀÇ ´Ù¾çÇÑ ºÐ¾ß¿¡¼ Ȱ¿ëµÇ°í ÀÖ´Ù. |
MIPS ¸Þ¸ð¸®
|
¿À´Ã³¯ ´ëºÎºÐÀÇ ÄÄÇ»Å͵éÀº µ¥ÀÌÅ͸¦ 8ºñÆ®(1¹ÙÀÌÆ®, ¹®ÀÚ±â·ÏÀÇ ±âº»´ÜÀ§) ´ÜÀ§·Î ¸Þ¸ð¸®¿¡ ÀúÀåÇÑ´Ù. MIPS´Â 0x00000000 ¿¡¼ 0xFFFFFFFF ¹üÀ§¿¡ ÇØ´çÇÏ´Â 32ºñÆ® ÁÖ¼Ò °ø°£À» °¡Áö°í ÀÖ´Ù. (2^32 = 4GBytes) ¸Þ¸ð¸®¿¡´Â ÇÁ·Î±×·¥ ¸í·É¾îµé°ú µ¥ÀÌÅ͵éÀÌ ÀúÀåµÈ´Ù. MIPS´Â ¾Æ·¡¿Í °°ÀÌ ¸Þ¸ð¸® °ø°£À» ¿¹¾àÇÏ¿© »ç¿ëÇÑ´Ù.
|
MIPS ·¹Áö½ºÅ͵é
|
MIPS´Â ¾Æ·¡¿Í °°ÀÌ 32°³ÀÇ ¹ü¿ë ·¹Áö½ºÅ͵éÀ» °¡Áö°í ÀÖ´Ù.
·¹Áö½ºÅÍ »ç¿ë¿¹ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
lw $t0, num1 #¸Þ¸ð¸® num1¿¡ ÀÖ´Â word(32ºñÆ®)¸¦
·¹Áö½ºÅÍ $t0·Î Load add $t0, $t3, $t4 # $t0 := $t3 + $t4 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
MIPS ÇÁ·Î±×·¥ ±¸Á¶(Assembly
Language)
|
# ÁÖ¼®¹®¿¡´Â ¼¥±âÈ£¸¦
ºÙÀδÙ. #
filename.s # ÀÌ ÆÄÀÏÀº
MIPS ¾î¼Àºí¸® ¾ð¾î ÇÁ·Î±×·¥ÀÇ ±¸Á¶ÀÌ´Ù. .data # ÀÌ ¶óÀÎ ´ÙÀ½ºÎÅÍ µ¥ÀÌÅÍ º¯¼öµéÀ» ¼±¾ðÇÑ´Ù. .text # ÀÌ ¶óÀÎ ´ÙÀ½ºÎÅÍ ¸í·É¾îµéÀ» ÄÚµùÇÑ´Ù. main: # ¸í·É Äڵ尡 ù¹øÂ°·Î ½ÃÀ۵Ǵ ÁöÁ¡ÀÌ´Ù. |
MIPS ¾î¼Àºí¸®
|
Instruction |
Operands |
Description |
|
add |
d,s,t |
d <-- s+t ; with overflow trap |
|
addu |
d,s,t |
d <-- s+t ; without overflow trap |
|
addi |
d,s,const |
d <-- s+const ; with overflow trap
const is 16-bit two's comp |
|
addiu |
d,s,const |
d <-- s+const ; without overflow trap
const is 16-bit two's comp |
|
and |
d,s,t |
d <-- bitwise AND of s with t |
|
andi |
d,s,const |
d <-- bitwise AND of s with const |
|
beq |
s,t,addr |
branch if s == t A branch delay slot follows the instruction. |
|
bgez |
s,addr |
Branch if the two's comp. integer in register s is >= 0 A branch delay slot follows the instruction. |
|
bltz |
s,addr |
Branch if the two's comp. integer in register s is < 0 A branch delay slot follows the instruction. |
|
bne |
s,t,addr |
branch if s != t A branch delay slot follows the instruction. |
|
div |
s,t |
lo <-- s div t ; hi <-- s mod t two's comp.
operands |
|
divu |
s,t |
lo <-- s div t ; hi <-- s mod t unsigned
operands |
|
j |
target |
after a delay of one machine cycle, PC <-- address
of target |
|
lb |
d,off(b) |
d <-- Sign-extended byte from
memory address b+off off is 16-bit
two's complement |
|
lbu |
d,off(b) |
d <-- Zero-extended byte
from memory address b+off
off is 16-bit two's complement |
|
lh |
d,off(b) |
t <-- Sign-extended halfword
from memory address b+off
off is 16-bit two's complement |
|
lhu |
d,off(b) |
t <-- Zero-extended halfword
from memory address b+off
off is 16-bit two's complement |
|
lui |
d,const |
upper two bytes of $t <-- two byte const lower two bytes of $t <-- 0x0000 |
|
lw |
d,off(b) |
d <-- Word from memory address b+off
off is 16-bit two's complement. |
|
mfhi |
d |
d <-- hi ; Move
From Hi |
|
mflo |
d |
d <-- lo ; Move
From Lo |
|
mult |
s,t |
hi / lo < -- s * t ;
two's comp operands |
|
multu |
s,t |
hi / lo < -- s * t ;
unsigned operands |
|
nor |
d,s,$0 |
d <-- bitwise NOT of s |
|
nor |
d,s,t |
d <-- bitwise NOR of s with t |
|
or |
d,s,$0 |
d <-- s |
|
or |
d,s,t |
d <--bitwise OR of s with t |
|
ori |
d,$0,const |
d <-- zero-extended const |
|
ori |
d,s,const |
d <-- s OR zero-extended const |
|
sb |
d,off(b) |
byte at off+b <-- low-order byte
from register $d. off is 16-bit two's complement |
|
sh |
d,off(b) |
two bytes at off+b <-- two low-order bytes
from register $d. off is 16-bit two's complement |
|
sll |
$0,$0,0 |
no operation |
|
sll |
d,s,shft |
d <-- logical left shift of s by shft positions
where 0 <= shft <
32 |
|
slt |
d,s,t |
if s < t d <-- 1 else d <-- 0 two's comp. operands |
|
slti |
d,s,imm |
if s < imm d <-- 1 else d <-- 0 two's comp. operands |
|
sltiu |
d,s,imm |
if s < imm d <-- 1 else d <-- 0 unsigned operands |
|
sltu |
d,s,t |
if s < t d <-- 1 else d <-- 0 unsigned operands |
|
sra |
d,s,shft |
d <-- arithmetic right shift of s by shft positions
where 0 <= shft <
32 |
|
srl |
d,s,shft |
d <-- logical right shift of s by shft positions
where 0 <= shft <
32 |
|
sub |
d,s,t |
d <-- s - t; with overflow trap |
|
subu |
d,s,t |
d <-- s - t; no overflow trap |
|
sw |
d,off(b) |
Word at memory address (b+off) <-- $t b is a register. off is 16-bit twos complement. |
|
xor |
d,s,t |
d <-- bitwise exclusive or of s with t |
|
xori |
d,s,const |
d <-- bitwise exclusive or of s with const |
|
|
|
|
|
|
||
|
ÀÌÆäÀÌÁöÀÇ ÀúÀÛ±ÇÀº |
||
|
Á¦¸ñ: MIPS ¼Ò°³ |
ÀúÀÚ¿¡°Ô ÀÖ½À´Ï´Ù |
|
|
ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com) |
ÃÖ±Ù¼öÁ¤ÀÏ:2009-01-18 |