aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-05 16:20:14 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-05 16:20:14 +0000
commitaadb21853a0defc9aeac55ee2f4d582ba0c52cf4 (patch)
tree1942decb845c368b896b36338a6a0370ac723210
parenta3d8e5ee1f430bb07e467247ee0b5f188fffd94c (diff)
downloadovm-aadb21853a0defc9aeac55ee2f4d582ba0c52cf4.tar.gz
ovm-aadb21853a0defc9aeac55ee2f4d582ba0c52cf4.tar.bz2
ovm-aadb21853a0defc9aeac55ee2f4d582ba0c52cf4.zip
Redefined proposed syntax for preprocessor in TODO.org
-rw-r--r--todo.org41
1 files 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