Skip to content

Commit c22ce3a

Browse files
committed
Fix some grammar, add a footnote...
Maybe I should expand that section more and maybe add a section in ch5 about how to use fp and/or pass arguments on the stack if necessary that I can refer to as "we'll cover making local variables on the stack in ch5". It just...seems unecessary and beyond the scope of the book since it's almost never used.
1 parent b6e3373 commit c22ce3a

File tree

5 files changed

+1148
-1144
lines changed

5 files changed

+1148
-1144
lines changed

book.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
= MIPS Assembly Programmming
44
Robert Winkler <[email protected]>
5-
v1.0.2, 2023-10-24
5+
v1.0.3, 2023-12-13
66
:toc:
77

88
include::info.adoc[]

ch1.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
:what_matters: footnote:[Obviously compilers have to follow stricter rules, but for the
2+
purposes of learning and actually using assembly directly, there's no reason to make your life
3+
harder than necessary.]
14

25
== Chapter 1: Data
36

@@ -57,11 +60,11 @@ int main()
5760
}
5861
----
5962

60-
The first thing you have to remember is that when converting from a higher level
61-
language to assembly (any assembly) is that what matters is whether it's functionally
62-
the same, not that everything is done in exactly the same way. In this instance,
63-
that means realizing that your literal strings and your local variables `name`
64-
and `age` become globals in MIPS.
63+
The first thing you have to remember when converting from a higher level language
64+
to assembly (any assembly), is that what matters is whether it is functionally
65+
the same, not whether everything is done in exactly the same way{what_matters}.
66+
In this instance, that means realizing that your literal strings and your local
67+
variables `name` and `age` become globals in MIPS.
6568

6669
[source,mips,linenums]
6770
----

ch5.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ The `$sp` register is technically preserved but not in the same way. Basically
166166
what you allocate (subtract) you have to deallocate (add) before returning
167167
from a function, thus preserving the original value.
168168

169-
You can ignore `$at, $k0-$k1, $gp` and most of the time `$fp` too. In over 5 years
169+
You can ignore `$at, $k0-$k1, $gp` and most of the time `$fp` too. In over 7 years
170170
of tutoring I've helped students with MIPS from at least 2 dozen different colleges
171171
and I think I've only seen a professor force his students to use `$fp`
172172
or pass more than 4 arguments twice. You can see{fp_is_s8} register 30 sometimes

0 commit comments

Comments
 (0)