aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-29 15:36:52 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-29 15:36:52 +0000
commit691069fa45d30814d6fc57a96376b234f6018344 (patch)
tree7c3064403b09168030ffb857b31f669548796454
parentf1fde81b82e7d08273a01f6270130782a3261395 (diff)
downloadovm-691069fa45d30814d6fc57a96376b234f6018344.tar.gz
ovm-691069fa45d30814d6fc57a96376b234f6018344.tar.bz2
ovm-691069fa45d30814d6fc57a96376b234f6018344.zip
Added todo for preprocessor "%MACRO"
This is different to "%CONST" in that it can take token parameters and use them. This allows the construction of user code at compile time, which can be very useful for a variety of use cases.
-rw-r--r--todo.org14
1 files changed, 14 insertions, 0 deletions
diff --git a/todo.org b/todo.org
index 039f7b8..3d6cdcf 100644
--- a/todo.org
+++ b/todo.org
@@ -76,6 +76,20 @@ That would be a very simple way of solving the static vs dynamic
linking problem: just include the files you actually need. Even the
standard library would be fine and not require any additional work.
Let's see how this would work.
+** TODO Macros
+Essentially constants expressions which take literal parameters
+(i.e. tokens) and can use them throughout the body. Something like
+#+begin_src asm
+%macro(name)(param1 param2 param3)
+...
+%end
+#+end_src
+Where each parameter is substituted in a call at preprocessing time.
+A call should look something like this:
+#+begin_src asm
+ $name 1 2 3
+#+end_src
+and those tokens will be substituted literally in the macro body.
* TODO Standard library :ASM:VM:
I should start considering this and how a user may use it. Should it
be an option in the VM and/or assembler binaries (i.e. a flag) or