aboutsummaryrefslogtreecommitdiff
path: root/tests/expected
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-02-02 22:38:16 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-02-02 22:38:16 +0100
commit4f1a9c660108e5fb94d5b19ee649427b8aafd96b (patch)
treed1eee54d6df59c4bef26ce8826cc6a9e9a957e32 /tests/expected
parente59465abdb58fd73cd1e8fc4565b866cfa19c149 (diff)
downloadtools.nes-4f1a9c660108e5fb94d5b19ee649427b8aafd96b.tar.gz
tools.nes-4f1a9c660108e5fb94d5b19ee649427b8aafd96b.zip
Add the .fallthrough control statement
This is exclusive to 'nasm' and it allows the developer to explicitly tell the assembler than a "fall through" condition is actually desired: it's not a mistake. This comes in two flavors. The first, without arguments, just makes this explicit without much enforcement. The second allows you to pass an argument which is the name of the function or label you are expecting to fall through. The assembler will error out if the fall through address is not the expected one, hence telling the programmer whenever the fall through condition they thought in the past is no longer true (e.g. the function has moved somewhere else in the code). Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'tests/expected')
-rw-r--r--tests/expected/bad_fallthrough.txt4
-rw-r--r--tests/expected/fallthrough.nesbin0 -> 21 bytes
-rw-r--r--tests/expected/fallthrough.txt0
3 files changed, 4 insertions, 0 deletions
diff --git a/tests/expected/bad_fallthrough.txt b/tests/expected/bad_fallthrough.txt
new file mode 100644
index 0000000..f105880
--- /dev/null
+++ b/tests/expected/bad_fallthrough.txt
@@ -0,0 +1,4 @@
+error: statement does not fall through (bad_fallthrough.s: line 11)
+error: statement does not fall through (bad_fallthrough.s: line 14)
+error: statement does not fall through (bad_fallthrough.s: line 15)
+error: statement does not fall through (bad_fallthrough.s: line 27)
diff --git a/tests/expected/fallthrough.nes b/tests/expected/fallthrough.nes
new file mode 100644
index 0000000..976f8fc
--- /dev/null
+++ b/tests/expected/fallthrough.nes
Binary files differ
diff --git a/tests/expected/fallthrough.txt b/tests/expected/fallthrough.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/fallthrough.txt