Skip to content

Commit 4b74ee7

Browse files
lesleyrsISSOtm
andauthored
Fix some mistakes (#28)
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
1 parent 3312b83 commit 4b74ee7

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/part1/header.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ So, we prevent disaster like this:
145145
{{#include ../assets/hello-world.asm:6:10}}
146146
```
147147

148-
The `ds` fills all bytes from $103 to $14F (inclusive) with the value $00.
148+
The directive `ds` stands for "define space", and allows filling a range of memory.
149+
This specific line fills all bytes from $103 to $14F (inclusive) with the value $00.
149150
Since different pieces of code and/or data cannot overlap, this ensures that the header's memory range can safely be overwritten by RGBFIX, and that nothing else accidentally gets steamrolled instead.
150151

151-
It may not be obvious how the `ds` fills is told to fill this specific memory range.
152+
It may not be obvious how this `ds` ends up filling that specific memory range.
152153
The 3-byte `jp` covers memory addresses $100, $101, and $102.
153154
(We start at $100 because that's where the `SECTION` is hardcoded to be.)
154155
When RGBASM processes the `ds` directive, `@` (which is a special symbol that evaluates to "the current address") thus has the value $103, so it fills `$150 - $103 = $4D` bytes with zeros, so $103, $104, ..., $14E, $14F.

src/part1/jumps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Once this lesson is done, we will be able to understand all of `CopyTiles`!
99
So far, all the code we have seen was linear: it executes top to bottom.
1010
But this doesn't scale: sometimes, we need to perform certain actions depending on the result of others ("if the crêpes start sticking, grease the pan again"), and sometimes, we need to perform actions repeatedly ("If there is some batter left, repeat from step 5").
1111

12-
Both of these imply reading the recipe non-lineraly.
12+
Both of these imply reading the recipe non-linearly.
1313
In assembly, this is achieved using *jumps*.
1414

1515
The CPU has a special-purpose register called "PC", for Program Counter.

src/part1/palettes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ BGP immediately updates, turning the screen black!
8181
</figure>
8282

8383
What if we wanted to take the original palette, but invert it?
84-
%11 would become %00, %01 would become %10, %10 would become %01, and %11 would become %00.
84+
%11 would become %00, %01 would become %10, %10 would become %01, and %00 would become %11.
8585
We would get thus:
8686

8787
```

0 commit comments

Comments
 (0)