summaryrefslogtreecommitdiffhomepage
path: root/mips.html.markdown
diff options
context:
space:
mode:
authorBoris Verkhovskiy <boris.verk@gmail.com>2024-04-03 02:30:27 -0700
committerGitHub <noreply@github.com>2024-04-03 02:30:27 -0700
commit6d87022050ffbd5d818781427329c5362e3df197 (patch)
tree3809b2b1a7790d8b30e6d694c575eb68f02f661c /mips.html.markdown
parentc76b8f690a577d9ff89947d79c36a96a7c3b4deb (diff)
parente8dabf3c1955e1a458e8bc936587ad59772a9c33 (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'mips.html.markdown')
-rw-r--r--mips.html.markdown8
1 files changed, 5 insertions, 3 deletions
diff --git a/mips.html.markdown b/mips.html.markdown
index 0e7a7d0c..3add0c5b 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'
@@ -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)
@@ -186,6 +186,7 @@ gateways and routers.
# else
# max = c;
# else
+ # if (b > c)
# max = b;
# else
# max = c;
@@ -212,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