Can anyone get through this MIPS code with me?

enter image description here

enter image description here

My first question is:

  • when setting up the stack space, why did you choose number 8? I assume this means 8 bytes, but how was it determined that it would take 8 bytes to configure? I know that we need to allocate enough space for all arguments (in this case, one argument), and I also assume that for the return address, but how do we know how many bytes each needs?

  • I am trying to read the code to understand what is happening, but I am confused about

beq $ t0, $ zero, L1.

I know that from here we lead to where he says L1, where n decreases by 1, but then I'm confused. Does

jal fact

, , , n = 1 n = 2? [, n = 2 ]. , , $a0 $v0?

, . , , , " "... 8 ? , , . , .

+3
1

enter image description here

1 :
"8" , "n" .

8 , . 4 ... - .
( ,
.
, )

beq: . $t0 $zero (.. $t0 0), L1.

jal...
, , : , .

, , .
, - , , .
, jal , jal.
:
,
hile jal.
,
, .
: jr.
,
, .
...
"" , ...

+1

All Articles