summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2019-01-12 14:51:06 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2019-01-12 14:51:06 -0500
commitb053ba068952a5b9a46890224dba95e96ffea82a (patch)
treee96a4b7e950a7c99c3a089cbfba7f9ec9d20ba10
parent18a296e451cbea1ba9ecec8584c7b891408ae2b8 (diff)
Two's complement
-rw-r--r--Add-a-new-move.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/Add-a-new-move.md b/Add-a-new-move.md
index fc7a714..d504626 100644
--- a/Add-a-new-move.md
+++ b/Add-a-new-move.md
@@ -185,7 +185,9 @@ I added `NASTY_PLOT` to these sets, based on their canon ones in later generatio
## 6. Adding a 255th move
-It's pretty easy to replace the unused moves 252, 253, and 254 ($FC, $FD, and $FE) using the steps above. But move 255 ($FF) is trickier. The value $FF is often used as a special case in the code: it's the maximum value a single byte can have, it marks the end of lists\* (note that $FF can be 255 or −1 depending on context, due to [two's complement](https://en.wikipedia.org/wiki/Two%27s_complement) arithmetic, so lists ending with `db -1` actually end with $FF), and using it like any other value can be difficult to impossible.
+It's pretty easy to replace the unused moves 252, 253, and 254 ($FC, $FD, and $FE) using the steps above. But move 255 ($FF) is trickier. The value $FF is often used as a special case in the code: it's the maximum value a single byte can have, it marks the end of lists, and using it like any other value can be difficult to impossible.
+
+(If you're wondering why so many lists end with `db -1`, not `db $ff`, that's because the byte $FF can be 255 or −1 depending on context, due to [two's complement](https://en.wikipedia.org/wiki/Two%27s_complement) arithmetic.)
### 6.1. Prepare move $FF