Moved preprocessor>Constants to Completed and started work on %USE

This commit is contained in:
2023-11-29 15:37:57 +00:00
parent 691069fa45
commit cad92bf3ba

View File

@@ -6,38 +6,7 @@
Like in FASM or NASM where we can give certain helpful instructions to Like in FASM or NASM where we can give certain helpful instructions to
the assembler. I'd use the ~%~ symbol to designate preprocessor the assembler. I'd use the ~%~ symbol to designate preprocessor
directives. directives.
** DONE Constants ** WIP Import another file
Essentially a directive which assigns some literal to a symbol as a
constant. Something like
#+begin_src asm
%const(n) 20 %end
#+end_src
Then, during my program I could use it like so
#+begin_src asm
...
push.word $n
print.word
#+end_src
The preprocessor should convert this to the equivalent code of
#+begin_src asm
...
push.word 20
print.word
#+end_src
2023-11-04: You could even put full program instructions for a
constant potentially
#+begin_src asm
%const(print-1)
push.word 1
print.word
%end
#+end_src
which when referred to (by ~$print-1~) would insert the bytecode given
inline.
** TODO Import another file
Say I have two "asm" files: /a.asm/ and /b.asm/. Say I have two "asm" files: /a.asm/ and /b.asm/.
#+CAPTION: a.asm #+CAPTION: a.asm
@@ -241,3 +210,34 @@ Proposed syntax:
#+begin_src asm #+begin_src asm
init <label> init <label>
#+end_src #+end_src
** DONE Constants
Essentially a directive which assigns some literal to a symbol as a
constant. Something like
#+begin_src asm
%const(n) 20 %end
#+end_src
Then, during my program I could use it like so
#+begin_src asm
...
push.word $n
print.word
#+end_src
The preprocessor should convert this to the equivalent code of
#+begin_src asm
...
push.word 20
print.word
#+end_src
2023-11-04: You could even put full program instructions for a
constant potentially
#+begin_src asm
%const(print-1)
push.word 1
print.word
%end
#+end_src
which when referred to (by ~$print-1~) would insert the bytecode given
inline.