From 691069fa45d30814d6fc57a96376b234f6018344 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 29 Nov 2023 15:36:52 +0000 Subject: 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. --- todo.org | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'todo.org') 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 -- cgit v1.2.3-13-gbd6f