From aadb21853a0defc9aeac55ee2f4d582ba0c52cf4 Mon Sep 17 00:00:00 2001
From: Aryadev Chavali <aryadev@aryadevchavali.com>
Date: Sun, 5 Nov 2023 16:20:14 +0000
Subject: Redefined proposed syntax for preprocessor in TODO.org

---
 todo.org | 41 +++++++++++++++++------------------------
 1 file changed, 17 insertions(+), 24 deletions(-)

diff --git a/todo.org b/todo.org
index c67f27d..60c6585 100644
--- a/todo.org
+++ b/todo.org
@@ -35,37 +35,30 @@ Something to consider is /static/ and /dynamic/ "linking" i.e.:
     + 63 bit references user code (not a lot of loss in precision)
     + Easy to check if a reference is a library reference or a user
       code reference by checking "sign bit" (negativity)
-* TODO Inlining subroutines :ASM:
-Essentially consider the following situation
+* TODO Preprocessing directives :ASM:
+Like in FASM or NASM where we can give certain helpful instructions to
+the assembler.  I'd use the ~%~ symbol to designate preprocessor
+directives.
+** TODO Constants
+Essentially a directive which assigns some literal to a symbol as a
+constant.  Something like
 #+begin_src asm
-  global _start
-a:
-  push.word 1
-  push.word 1
-  plus.word
-  print.word
-  ret
-_start:
-  call a
-  halt
+%const:n:20%end
 #+end_src
-What I'd like to be able to do is:
+
+Where you'd refer to the definition using ~$n~.  The assembler will
+look for symbols like ~$n~ and insert definitions it finds for them.
+Can be useful when defining data type bounds and other useful constants.
+
+2023-11-04: You could even put full program instructions for a
+constant potentially
 #+begin_src asm
-  global _start
-%inline:a:
+%const:print-1:
   push.word 1
-  push.word 1
-  plus.word
   print.word
-  ret
 %end
-_start:
-  %inline a
-  halt
 #+end_src
-This is equivalent in LOC, but in terms of the actually output
-instructions the second is smaller in size, doesn't use any jumps nor
-does it use the call stack.  As a result it's a linear program.
+which when referred to ~$print-1~ would just insert the bytecode given inline.
 * Completed
 ** DONE Write a label/jump system :ASM:
 Essentially a user should be able to write arbitrary labels (maybe
-- 
cgit v1.2.3-13-gbd6f