๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

Qtspim10

[MIPS] MIPS programming ๊ณผ์ œ - N๊ฐœ์˜ ๋ณ„ ์ถœ๋ ฅํ•˜๊ธฐ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ N๊ฐœ์˜ ๋ฌธ์ž๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ธ opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 addi addi $s1, $t0, Int $s1 = $t0 + Int sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1.. ruas-coding.tistory.com Q. syscall์„ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ์ž์—ฐ์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›๊ณ , ์ฒซ์งธ ์ค„์—๋Š” ๋ณ„ 1๊ฐœ.. 2021. 12. 17.
[MIPS] MIPS programming ๊ณผ์ œ - factorial ์—ฐ์‚ฐ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Factorial ์—ฐ์‚ฐ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ธ opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 addi addi $s1, $t0, Int $s1 = $t0 + Int sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1.. ruas-coding.tistory.com Q. syscall์„ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ์–‘์˜ ์ •์ˆ˜ ๊ฐ’ 10์„ ์ž…๋ ฅ ๋ฐ›๊ณ .. 2021. 11. 16.
[MIPS] MIPS programming ๊ณผ์ œ - array ์‚ฌ์šฉํ•˜๊ธฐ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ array์— parameter๋ฅผ ๋Œ€์ž…ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ธ opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1 = $t0 * $t1 mult mult $t0, $t1 Lo, Hi.. ruas-coding.tistory.com Q. ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ฐธ์กฐํ•˜์—ฌ ๋ณ€์ˆ˜ d์˜ ๊ฐ’์„ 1์”ฉ ๊ฐ์†Œ์‹œํ‚ค๋ฉด์„œ ๋ฐฐ์—ด a.. 2021. 11. 12.
[MIPS] MIPS programming ๊ณผ์ œ - ((i + j) * 2) ์—ฐ์‚ฐ ์ˆ˜ํ–‰ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์น™ ์—ฐ์‚ฐ์„ ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ด opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1 = $t0 * $t1 mult mult $t0, $t1 Lo, Hi.. ruas-coding.tistory.com Q. ์ •์ˆ˜ ๊ฐ’ i์™€ j๋ฅผ parameter๋กœ ๋ฐ›๊ณ  ((i + j) * 2) ํ•œ ๊ฒฐ๊ณผ ๊ฐ’์„ ๋ฐ˜.. 2021. 11. 11.
[MIPS] MIPS programming ๊ณผ์ œ - ์ ˆ๋Œ€ ๊ฐ’ ๊ณ„์‚ฐํ•˜๊ธฐ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ ˆ๋Œ€ ๊ฐ’ ์—ฐ์‚ฐ์„ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ธ opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1 = $t0 * $t1 mult mult $t0, $t1 Lo, Hi.. ruas-coding.tistory.com Q. a = |c - d| ์—์„œ ์ •์ˆ˜ ๋ณ€์ˆ˜ c์™€ d์˜ ์ฐจ์ด ๊ฐ’ a๋ฅผ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑ.. 2021. 11. 9.
[MIPS] MIPS programming ๊ณผ์ œ - ์—ฐ์†๋œ ์ •์ˆ˜ ์ถœ๋ ฅํ•˜๊ธฐ ์˜ค๋Š˜์€ MIPS๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํŠน์ • ์ •์ˆ˜๋ณด๋‹ค ์ž‘์€ ์ •์ˆ˜ ์ค‘ ๊ฐ€์žฅ ํฐ 4๊ฐœ์˜ ์ˆซ์ž๋ฅผ ๋‚ด๋ฆผ์ฐจ์ˆœ์œผ๋กœ ์ถœ๋ ฅํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์„ค๋ช…๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ์— ์•ž์„œ ๊ธฐ๋ณธ์ ์ธ opcode ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. [MIPS] MIPS programming ๊ธฐ๋ณธ [MIPS] MIPS programming ๊ธฐ๋ณธ opcode Artithmetic Instructions opcode ์‚ฌ์šฉ ๋ฐฉ๋ฒ• ์˜๋ฏธ add add $s1, $t0, $t1 $s1 = $t0 + $t1 sub sub $s1, $t0, $t1 $s1 = $t0 - $t1 mul mul $s1, $t0, $t1 $s1 = $t0 * $t1 mult mult $t0, $t1 Lo, Hi.. ruas-coding.tistory.com Q. ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ์–‘์˜ ์ •์ˆ˜ ํ•˜๋‚˜๋ฅผ .. 2021. 11. 3.
728x90