tests: Added tests for using macros with defines and .defs in an
authorLukas Krickl <lukas@krickl.dev>
Mon, 14 Apr 2025 13:51:24 +0000 (15:51 +0200)
committerLukas Krickl <lukas@krickl.dev>
Mon, 14 Apr 2025 13:51:24 +0000 (15:51 +0200)
expression

BUGS.md
tests/t0.bin
tests/t0.s
tests/t0_dasm.s

diff --git a/BUGS.md b/BUGS.md
index e4502864a6c95d2ac64267f98a4cb30ca2683795..97fed4bb3c2cd7208d7f622b85bf5a07b4f4123b 100644 (file)
--- a/BUGS.md
+++ b/BUGS.md
@@ -1,17 +1,2 @@
 # Known Bugs
 
-## It is not possible to use #define as macro arguments
-
-To reproduce:
-
-- Create a macro
-- #define a constnat
-- Pass the constant as argument
-
-Expected
-
-- The macro uses the constant as is
-
-Acrual:
-
-- The constant fails to resolve
index 28305ddd4df59ae91de988c84f4b02ee06e19475..d41e18491e41b6202e206a0b53959dbd95b81574 100644 (file)
Binary files a/tests/t0.bin and b/tests/t0.bin differ
index cf5d7ac60940f3c6a9011565070c4151f93c2c67..89c614360cb398dc43e96a010981c31e3388234f 100644 (file)
@@ -202,3 +202,11 @@ test_scoped:
 @behind_scope:
   nop
 
+.def int arg_p = 2 
+
+#macro defarg2 
+  .db $1 + 1, $2
+  .db $1
+#endmacro
+
+defarg2 DEFARG * arg_p, arg_p
index 3a4aa2bd6d1514a045fbffda3ea90869dd5ad0c2..4191bb5be84c47de1ca912b702b043217bd28e1f 100644 (file)
   ld bc, 0x0
   jp 0x1e4
   jp 0x1f2
-.db 0x0
+  nop 
+  inc bc
+  ld [bc], a
+.db 0x2