YYYEJI

[MIPS] MIPS Instructions 간단하게 살펴보기 본문

Computer architectures

[MIPS] MIPS Instructions 간단하게 살펴보기

YEJI ⍢ 2022. 9. 25. 02:13
728x90

① Arithmetic Instruction

ADD  $s0,  $s1, $s2                                                # $s0 ← $s1 + $s2

ADDI   $s0,  $s1,  100                                              # $s0 ← $s1 + 100

SUB  $ s0,  $s1,  $s2                                              # $s0 ← $s1 - $s2

MULT  $s1,  $s2                                                  # Hi, Lo ← $s1 * $s2

DIV  $s1,  $s2                                                       # Hi, Lo ← $s1 / $s2

MFHI  $s1                                                                              # $s1 ← Hi

MFLO   $s1                                                                           # $s1 ← Lo

 

( MFHI → Move From High, MFLO → Move From Low )

 

 

 

② Logical Instructions

AND  $s0,  $s1,  $s2                         # $s0 ← $s1  bitwise-AND  $s2

OR  $s0,  $s1,  $s2                              # $s0 ← $s1  bitwise-OR  $s2

ANDI  $s0,  $s1,  31                          # $s0 ← $s1  bitwise-AND  $s2

ORI  $s0,  $s1,  32                               # $s0 ← $s1  bitwise-OR  $s2

NOR  $s0,  $s1,  $s2                        # $s0 ← $s1  bitwise-NOR  $s2

SLL  $s0,  $s1,  10                    # $s0 ← $s1  << 10 (shift left logical)

SRL  $s0,  $s1,  10                 # $s0 ← $s1  << 10 (shift right logical)

 

 

 

 

◡̈

 

'Computer architectures' 카테고리의 다른 글

[MIPS] Conditional branch Instruction (BEQ, BNE)  (0) 2022.09.25
[MIPS] Instruction (Load, Store)  (0) 2022.09.25
[MIPS] Design Principles  (0) 2022.09.24
[MIPS] Register Model - 2  (2) 2022.09.24
[MIPS] Register Model - 1  (0) 2022.09.24