aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md13
1 files changed, 9 insertions, 4 deletions
diff --git a/README.md b/README.md
index d57385b..f57193d 100644
--- a/README.md
+++ b/README.md
@@ -254,7 +254,7 @@ By simply looking at this you quickly know that:
Even if the name turns out to not be too flashy, it's imperative when writing
assembly code to be as clear as possible.
-## UPPER_CASE for macros and aliases to memory-mapped I/O
+## UPPER_CASE for macros and regular constants
In a similar spirit as many code styles for C, use `UPPER_CASE` for macros, as
that makes it more apparent what they are.
@@ -269,13 +269,18 @@ that makes it more apparent what they are.
.endmacro
```
-In a similar way, there are some assignments which are simply aliases to
-memory-mapped I/O. These "variables" are to be defined also in upper case as
-they are quite special.
+In a similar way, there are assignments which are simply a way to name regular
+numeric constants. This differs to how "variables" are assigned as they are not
+memory addresses that the CPU can directly access. Hence, for constant numbers
+or memory addresses which are not directly tied to the CPU (i.e. memory-mapped
+I/O), use upper case in the same way you would in C.
``` assembly
lda PPU::m_control ; bad!
lda PPU::CONTROL ; good!
+
+bad_constant = 1
+GOOD_CONSTANT = 1
```
# Calling conventions