UTF-404

MIPS (1) 본문

컴퓨터 구조

MIPS (1)

UTF-404 2024. 3. 2. 21:58
728x90

💡Write a MIPS program that results in the following when running your MIPS program.

결과 예시 화면!!

 

➡️ 이번 과제는 MIPS 언어를 활용하여 위의 결과 화면과 같이 나오게 하면된다.

첫번째 줄에는 자신의 학번(Student ID)를 출력하는 것이다.

두번째와 세번째는 각각 숫자를 입력받을 수 있도록 한다.

마지막으로 앞서 입력 받은 숫자를 더한 값을 최종 결과값으로 출력하는 것이 이번 과제의 핵심 목표이다.

확장자는 .asm 파일로 저장하면 된다.

 

📍 MIPS 언어란?

MIPS(Microprocessor without Interlocked Pipeline Stages)란 MIPS Technologies에서 개발한 RISC 계열의 명령어 집합 체계이다.
MIPS 명령어 체계는 굉장히 깔끔하게 설계되어 있기 때문에 많은 대학교의 컴퓨터 아키텍처 과목에서 가르치고 있다.

<참고>

https://namu.wiki/w/MIPS

 

MIPS

개요 MIPS(Microprocessor without Interlocked Pipeline Stages)란 MIP

namu.wiki

 

.data
    studentid: .asciiz "My student ID is B993132 \n"
    prompt1: .asciiz "Please, type 1st number: "
    prompt2: .asciiz "Please, type 2nd number: "
    result: .asciiz "The result is: "

.text
main:

    li $v0, 4        
    la $a0, studentid 
    syscall       

    li $v0, 4
    la $a0, prompt1
    syscall

    li $v0, 5
    syscall
    move $t0, $v0

    li $v0, 4
    la $a0, prompt2
    syscall

    li $v0, 5
    syscall
    move $t1, $v0

    add $t2, $t0, $t1

    li $v0, 4
    la $a0, result
    syscall

    li $v0, 1
    move $a0, $t2
    syscall

    li $v0, 10
    syscall

 

 

 

 

728x90

'컴퓨터 구조' 카테고리의 다른 글

MIPS(4)  (0) 2024.03.02
MIPS(3)  (0) 2024.03.02
MIPS(2)  (0) 2024.03.02