From 1524547b4dd526f4f9aac3bab270f1786fb0b4a9 Mon Sep 17 00:00:00 2001 From: Flopsey <25252925+Flopsey@users.noreply.github.com> Date: Thu, 26 Aug 2021 16:48:24 +0200 Subject: [mips/en] Fix uncommented comment line (#4223) --- mips.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 33d4f87c..4977cc65 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -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 -- cgit v1.2.3 From fd3b5cf62961c15f59acb63dad86865fc01ecb78 Mon Sep 17 00:00:00 2001 From: NightMachinary <36224762+NightMachinary@users.noreply.github.com> Date: Wed, 22 Dec 2021 23:10:43 +0330 Subject: Fixed errors (#4227) --- mips.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 4977cc65..7f679082 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -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 -- cgit v1.2.3 From d208b72f6a82a78487b92382f204fbaa8a32990f Mon Sep 17 00:00:00 2001 From: Brian Holbrook <83974085+holbrookdev@users.noreply.github.com> Date: Thu, 3 Mar 2022 01:44:38 -0600 Subject: [mips/*] Fix branching example (#4315) --- mips.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 7f679082..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 -- cgit v1.2.3 From bba9f7df211d63293e2a957872d156a0a6dfcd48 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Sat, 10 Dec 2022 12:05:34 -0300 Subject: Fixes typos in many different English articles Signed-off-by: Marcel Ribeiro-Dantas --- mips.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 0e7a7d0c..31f735b0 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -111,7 +111,7 @@ gateways and routers. sub $t2, $t0, $t1 # $t2 = $t0 - $t1 mul $t2, $t0, $t1 # $t2 = $t0 * $t1 div $t2, $t0, $t1 # $t2 = $t0 / $t1 (Might not be - # supported in some versons of MARS) + # supported in some versions of MARS) div $t0, $t1 # Performs $t0 / $t1. Get the # quotient using 'mflo' and # remainder using 'mfhi' -- cgit v1.2.3 From d7356d4b39455ac68d33ebb12037d7fd2351772e Mon Sep 17 00:00:00 2001 From: xnumad <34810600+xnumad@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:33:35 +0100 Subject: Correct comment the s in the mnemonic slt is not for signal but for set slt = "Set on Less Than" according to the manual --- mips.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 31f735b0..b5e35525 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -162,7 +162,7 @@ gateways and routers. blt $t0, $t1, t0_gt_t1 # Branches when $t0 < $t1 ble $t0, $t1, t0_gte_t1 # Branches when $t0 <= $t1 bltz $t0, t0_lt0 # Branches when $t0 < 0 - slt $s0, $t0, $t1 # Instruction that sends a signal + slt $s0, $t0, $t1 # "Set on Less Than" # when $t0 < $t1 with result in $s0 # (1 for true) -- cgit v1.2.3 From f1a149c86036a7686ac1cfae3983370e9347d6e6 Mon Sep 17 00:00:00 2001 From: xnumad <34810600+xnumad@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:35:30 +0100 Subject: Fix branching example Was only wrong in the Java code, assembly code seems fine. --- mips.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index b5e35525..6f48dc33 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -186,6 +186,7 @@ gateways and routers. # else # max = c; # else + # if (b > c) # max = b; # else # max = c; -- cgit v1.2.3 From d1d1c4af865fdbcfa23225bc4d3b193f0d399b5f Mon Sep 17 00:00:00 2001 From: xnumad <34810600+xnumad@users.noreply.github.com> Date: Fri, 24 Mar 2023 21:43:38 +0100 Subject: Fix off-by-one error Iterate from 0..9, i.e. while $t0 is < 10 --- mips.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mips.html.markdown') diff --git a/mips.html.markdown b/mips.html.markdown index 6f48dc33..3add0c5b 100644 --- a/mips.html.markdown +++ b/mips.html.markdown @@ -213,8 +213,9 @@ gateways and routers. # instruction to continue its execution li $t0, 0 while: - bgt $t0, 10, end_while # While $t0 is less than 10, + bgt $t0, 9, end_while # While $t0 is less than 10, # keep iterating + #actual loop content would go here addi $t0, $t0, 1 # Increment the value j while # Jump back to the beginning of # the loop -- cgit v1.2.3