Replies: 1 comment 1 reply
-
Unfortunately, we still don't have any support for variables; everything has to be done with constants (which, in the current multi-pass architecture, ensures that there can't be any inconsistencies between passes). I'm trying to come up with support for variables in the future. So that rules out any form of dynamic data-structure at assembly-time for now. You may have to choose a different kind of data-structure (like a simple array of statically-known pointers that you can manually write in the source-code) or you may have to construct the linked-list either at runtime on startup of your kernel, or as a post-processor step in your development environment that modifies the assembled kernel binary. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to redefine labels or are there variables in customasm that can be used as such?
My use case is trying to build a Forth language kernel. Forth defines a dictionary of words (roughly its equivalent to functions) that is extensible and searchable and this is typically done using a linked list - the words have a header structure which includes a link to the previous definition. The kernel includes a reasonably large number of predefined words that need this linkage. In the implementations I have seen, a macro is defined to create these headers, that inserts the value of a variable which is set to the address of the last definition and then updates that variable to the address of the current header structure, ready for the next definition.
I can't see how best to achieve this in customasm at the moment.
Beta Was this translation helpful? Give feedback.
All reactions