Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- ROS2
- 정렬
- sort
- 3dof
- 정처기
- 컴퓨터구조
- Java
- Coding
- SQL
- 회전 복잡도
- homogeinous
- sam2
- 맥케이브
- 정보처리기사
- 리눅스
- humble
- CentOS
- Linux
- 자격증
- 합병
- Computer
- segmentation
- 알고리즘
- homogenous
- robotics
- 네트워크 충돌
- AI
- 명령어
- 기구학
- MIPS
Archives
- Today
- Total
UTF-404
MIPS(4) 본문
728x90
💡 MIPS 프로그래밍 조건 사항
- At first, understand what the following C code is about.
- Then, write and submit MIPS program performing to meet the following C code’s Input & output.
- The MIPS program doesn’t need to be exactly same as the C code, but Input/Output are same.

.data
prompt: .asciiz "Enter an int: "
result_msg: .asciiz "The result is: "
.text
.globl main
main:
li $v0, 4
la $a0, prompt
syscall
li $v0, 5
syscall
move $t0, $v0
li $t1, 0
loop:
beq $t0, $zero, done
andi $t2, $t0, 1
beqz $t2, bit_clear
addi $t1, $t1, 1
bit_clear:
srl $t0, $t0, 1
j loop
done:
li $v0, 4
la $a0, result_msg
syscall
li $v0, 1
move $a0, $t1
syscall
li $v0, 10
syscall728x90