aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-02-10 14:32:37 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-02-10 14:32:37 +0100
commit21cbede5330d7fd61412a299aaabc5e6c2879066 (patch)
treed9b646cda072da1658dd1311beaa718d357bb2f3
parent4fe5d54fb9dcd8e87b7a4eceff538f969df8ad3d (diff)
downloadstyle.nes-21cbede5330d7fd61412a299aaabc5e6c2879066.tar.gz
style.nes-21cbede5330d7fd61412a299aaabc5e6c2879066.zip
Improve wording on saving registers by the caller
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
-rw-r--r--README.md11
1 files changed, 5 insertions, 6 deletions
diff --git a/README.md b/README.md
index 3634079..144c28e 100644
--- a/README.md
+++ b/README.md
@@ -310,12 +310,11 @@ suffice, while other times using the memory might be needed. In any case:
## Registers are to be saved by the caller
-To make things easier when implementing functions, as a caller don't expect
-values on registers to survive to a function call. If there is important
-information to be kept or updated across calls, make sure to shadow it on memory
-addresses which are guaranteed to not be touched (on that check on the
-function's documentation!). Another option is to use the stack, but do so with
-caution as stack overflows are a real danger here.
+As a general rule, as a caller don't expect values on registers to survive to a
+function call. If there is important information to be kept or updated across
+calls, make sure to shadow it on memory addresses which are guaranteed to not be
+touched (on that check on the function's documentation!). Another option is to
+use the stack, but do so with caution as stack overflows are a real danger here.
## Reserve return values and arguments into zeropage