일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- python
- system
- web
- Class
- control
- DB
- Linux
- react
- XML
- Algorithm
- php
- data structure
- DS
- MacOS
- computer
- html
- mysql
- while
- instruction
- DATAPATH
- DoM
- CSS
- for
- MIPS
- javascript
- function
- Pipelining
- Java
- architecture
- github
- Today
- Total
목록system (66)
YYYEJI

Pseudo instruction란? 실제 instruction은 아니지만 컴퓨터가 이해할 수 있는 instruction입니다. ✓ 간결한 코딩이 가능 ✓ 생산성이 향상 ① COPY Ex) move $t0, $t1 → MIPS에서는 add $t0, $t1, $zero로 인식합니다. ② Branch if Less Than Ex) blt $t0, $t1, L → if ($t0 $t1) goto L ④ Branch if Greater (Less) Than or Equal to Ex) bge $t0, $t1, L → if ($t0 >= $t1) goto L ◡̈

LUI란? Load upper immediate instruction의 줄임말로써, 16bits보단 크고 32bits 보단 작은 상수를 어떻게 표현하냐에 대한 대답입니다. LUI $t0, 255 001111 00000 01000 0000 0000 1111 1111 ↓ 0000 0000 1111 1111 0000 0000 0000 0000 ↑ Upper ↑ ↑ Lower ↑ 이렇게 표현됩니다. 예제를 통해 더 자세히 알아봅시다. Q) What is MIPS assembly code for 32-bit constant "0x003D 0900" into $s0? ↓↓↓ solution ↓↓↓ LUI $t0, 0x003D ORI $s0, $t0, 0x0900 LUI 수행 없이 ORI를 실행시키면 상수가 덮어씌어..

Stored program Concept는 Memory에 저장하고 실행시키는 방법이라고 할 수 있습니다. ✓ Hardware에 올라온 program을 byte code로 memory에 올라옵니다. ✓ Instruction 한 줄씩 IR에 가져(fetch)와서 실행(execute)합니다. ✓ 프로그램은 메모리에 숫자 형태로 저장됩니. ✓ data, user program, compilers, editors 등 0과 1로 저장되는데 구분되지 않습니다. 여기서 등장하는 개념이 하나 더 있습니다. Fetch & Execute Cycle ① Memory에 저장된 Instruction을 CPU에 하나씩 fetch한다. ② IR에 fetch된 instruction을 파악하고 execute한다. ①~②번이 계속 반복되..

OP code Function code Instruction format ↑↑↑ 위에 표들을 참고해서 문제를 푸시면 됩니다 ↑↑↑ Loop: add $t1, $s3, $s3 add $t1, $t1, $t1 add $t1, $s3, $s6 lw $t0, 0($t1) bne $t0, $s5, Exit add $s3, #s3, #s4 j Loop Exit: Q1) add $t1, $s3, $s3 0 19 19 9 0 32 Binary: 000000 10011 10011 01001 00000 100000 Hexadecimal: 0x02734820 Q2) add $t1, $st1, $t1 0 9 9 9 0 32 Q3) add $t1, $t1, $s6 0 9 22 9 0 32 Q4) lw $t0, 0($t1) 35..

MIPS에는 3개의 instruction format이 있습니다. ① R type - 6field ② I type - 4field ③ J type - 2 field Instruction format을 살펴보기 전에 용어부터 살펴봅시다. R type에서는 ✓ op - operation code (opcode) ✓ rs - first source operand ✓ rt - second source operand ✓ rd - destination operand ✓ shamt - shift amount ✓ funct - funcion code I type에서는 ✓ op - operation code (opcode) ✓ rs - source operand ✓ rt - destination operand 다음으로는..

① Arithmetic instruction Format Instruction Format Meaning R ADD ADD rd, rs, rt rd ← rs+ rt R SUB SUB rd, rs, rt rd ← rs - rt I ADDI ADDI rt, rs, imm16 rt ← rs + se(imm16) R SLT SLT rd, rs, rt rd ← (rs

아래 코드를 가지고 설명하겠습니다. ✓ 코드를 작성할 땐 textEdit(메모장), visual Studio 등을 사용하시면 됩니다. ↓↓↓ C language code ↓↓↓ #include int main(){ printf("Hello World!!!\n"); return 0; } ↓↓↓ Assembly language code ↓↓↓ # test.s # print "Hello World!!!" .data str: .asciiz "\nHello, World!\n" .text main: li $v0, 4 la $a0, str syscall li $v0, 10 syscall pseudo assembly instruction MIPS 언어에는 pseudo assembly instruction이 존재합니다...

OtSpim 사용법에 대해서 알아보겠습니다. ↓↓↓ 설치를 위해서 링크를 클릭해 주세요 ↓↓↓ https://yyyeji.tistory.com/149 [MacOS] OtSpim 다운로드하기 Spim 이란? MIPS chip이 아니여도 assembly 코드를 읽고 실행시켜 주는 simulator입니다. 여러 OS(window, mac os, linux)에서 한 줄씩 실행시켜 줍니다. (interface) (앞에 붙은 Ot는 최신 버전을 뜻합니다.) ↓.. yyyeji.tistory.com 아래 사진들은 Otspim을 실행했을 때 나오는 첫 화면들입니다. ✓ 새로운 파일을 생성할 때 쓰는 확장자는 .a or .s or .asm 입니다. ✓ assembly 언어가 화면에 뜰 때 정확히 일치하지 않을 수도 있습..