aboutsummaryrefslogtreecommitdiff
path: root/tests/defines.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-22 21:46:03 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-22 21:56:45 +0100
commit4a7e8db884fdaa80f6a026ec4c0c8409ea975d81 (patch)
treed7d23256b75e9cfa20390c888212841fbd4e32c5 /tests/defines.s
parent179a68792e980a1d12bd67d57e593aab9f27ca30 (diff)
downloadtools.nes-4a7e8db884fdaa80f6a026ec4c0c8409ea975d81.tar.gz
tools.nes-4a7e8db884fdaa80f6a026ec4c0c8409ea975d81.zip
nasm: Implement the -D flag
This allows users to define variables directly from the command line, which is useful for testing purposes. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'tests/defines.s')
-rw-r--r--tests/defines.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/defines.s b/tests/defines.s
new file mode 100644
index 0000000..6f92756
--- /dev/null
+++ b/tests/defines.s
@@ -0,0 +1,18 @@
+.segment "HEADER"
+ .byte 'N', 'E', 'S', $1A
+ .byte $02
+ .byte $01
+ .byte $00
+ .byte $00
+
+.segment "CODE"
+
+.ifdef LALA
+ .if LALA == 1
+ lda #0
+ .else
+ lda #1
+ .endif
+.else
+ lda #2
+.endif