diff options
author | Marcel Ribeiro Dantas <ribeirodantasdm@gmail.com> | 2022-06-27 00:28:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 00:28:16 +0200 |
commit | 5d133e847846b4c8d436f7a567674c2e1df35a13 (patch) | |
tree | 7ebc7704f02ceef195a8896a80a06ed81cc12585 /mips.html.markdown | |
parent | 27f7f03401ff747a61a912fdf73549b1788b13e1 (diff) | |
parent | 8f28c8021b8ce3cb791861ad19c41e12228d8bcd (diff) |
Merge branch 'master' into patch-1
Diffstat (limited to 'mips.html.markdown')
-rw-r--r-- | mips.html.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mips.html.markdown b/mips.html.markdown index 33d4f87c..0e7a7d0c 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -193,7 +193,7 @@ gateways and routers. # Let $s0 = a, $s1 = b, $s2 = c, $v0 = return register ble $s0, $s1, a_LTE_b # if(a <= b) branch(a_LTE_b) ble $s0, $s2, max_C # if(a > b && a <=c) branch(max_C) - move $v0, $s1 # else [a > b && a > c] max = a + move $v0, $s0 # else [a > b && a > c] max = a j done # Jump to the end of the program a_LTE_b: # Label for when a <= b @@ -242,7 +242,7 @@ gateways and routers. ## FUNCTIONS ## _functions: # Functions are callable procedures that can accept arguments and return - values all denoted with labels, like above + # values all denoted with labels, like above main: # Programs begin with main func jal return_1 # jal will store the current PC in $ra @@ -293,7 +293,7 @@ gateways and routers. fact_done: lw $s0, ($sp) - lw $ra, ($sp) # Restore the PC + lw $ra, 4($sp) # Restore the PC addi $sp, $sp, 8 jr $ra @@ -357,7 +357,7 @@ gateways and routers. li $t1, 5 # Length of the list loop: - bgt $t0, $t1, end_loop + bge $t0, $t1, end_loop lw $a0, ($s0) li $v0, 1 |