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
- architecture
- javascript
- MIPS
- DB
- Linux
- Class
- python
- DS
- for
- system
- instruction
- react
- CSS
- control
- data structure
- Algorithm
- php
- github
- web
- computer
- XML
- mysql
- function
- while
- html
- MacOS
- Java
- DATAPATH
- DoM
- Pipelining
Archives
- Today
- Total
YYYEJI
[MIPS] Procedure call 본문
728x90
Procedure 란
C에서 흔히 말하는 function을 말합니다.
subroutine이라는 이름도 사용합니다.
즉, Procedure, function, subroutine은 함수를 의미하는 단어들 입니다.
Procedure call 은 함수를 부르는 과정입니다.
MIPS에서 procedure에 관련된 공간은 아래와 같습니다.
① $a0 ~ $a3 - argument
② $v0 ~ $v1 - return value
③ $ra - return address
procedure call 을 할 때 사용하는 instruction은 JAL과 JR이 있습니다.
① JAL Label - function call 이 실행되면
✓ $ra ← 104 (Current PC value)
✓ PC ← 200 (from 104)
② JR $ra - function return 이 실행되면
✓ PC ← 104 (from $ra)
이렇게 함수가 MIPS에서 사용됩니다.
NOTE) 위 그림에서 caller는 main function,
callee는 label function 입니다.
◡̈
'Computer architectures' 카테고리의 다른 글
[CA] Simple Memory Layout (0) | 2022.10.13 |
---|---|
[MIPS] Procedure Call using Stack (0) | 2022.10.10 |
[MIPS] Addressing mode (0) | 2022.10.10 |
[MIPS] Pseudo Instructions (0) | 2022.10.10 |
[MIPS] LUI instruction (0) | 2022.10.10 |