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 |
31 |
Tags
- Coding
- 회전 복잡도
- robotics
- Computer
- 정처기
- AI
- sam2
- 3dof
- humble
- CentOS
- homogenous
- 정렬
- 알고리즘
- MIPS
- 맥케이브
- Java
- 명령어
- 컴퓨터구조
- segmentation
- SQL
- 리눅스
- 소스 코드 품질 분석
- homogeinous
- 네트워크 충돌
- 기구학
- 합병
- Linux
- sort
- 정보처리기사
- ROS2
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
syscall
728x90