Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- html
- github
- function
- Algorithm
- while
- Class
- MIPS
- instruction
- Pipelining
- web
- react
- DoM
- Linux
- CSS
- for
- DATAPATH
- DB
- architecture
- data structure
- mysql
- python
- php
- control
- system
- MacOS
- DS
- XML
- Java
- computer
- javascript
Archives
- Today
- Total
목록ASSENBLY (1)
YYYEJI
[MIPS] 1부터 N 사이의 3의 배수의 합을 구하는 assembly code
** C code를 기준 ** 아래 코드를 MIPS assembly code로 변환해 보겠습니다. #include int main(void){ int i = 1; int sum = 0; int n = 15; while(in) goto exit div $t0, $t2 # hi = i/3 mfhi $t3 # t3 = hi bne $t3, $zero, loop # if (t3 != 0) goto loop add $t1, $t1, $t0 # sum += i j loop exit: li $v0, 4 la $a0, str1 syscall li $v0, 1 add $a0, $zero, $t1 syscall .end .text 코드를 하나하나 살펴보면 main: addi $t0, $zero, 0 # i = 0 addi..
Computer architectures
2022. 10. 20. 18:00