diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tile/word.mu | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/tile/word.mu b/apps/tile/word.mu index 1fb214a6..72a55733 100644 --- a/apps/tile/word.mu +++ b/apps/tile/word.mu @@ -25,19 +25,6 @@ fn allocate-word-with _out: (addr handle word), s: (addr array byte) { initialize-word-with out-addr, s } -# TODO: handle existing next -# one implication of handles: append must take a handle -fn append-word _self-ah: (addr handle word) { - var self-ah/esi: (addr handle word) <- copy _self-ah - var self/eax: (addr word) <- lookup *self-ah - var next-ah/eax: (addr handle word) <- get self, next - allocate next-ah - var next/eax: (addr word) <- lookup *next-ah - initialize-word next - var prev-ah/eax: (addr handle word) <- get next, prev - copy-handle *self-ah, prev-ah -} - # just for tests for now # TODO: handle existing next # one implication of handles: append must take a handle @@ -110,3 +97,16 @@ fn print-word screen: (addr screen), _self: (addr word) { var data/eax: (addr gap-buffer) <- get self, data render-gap-buffer screen, data } + +# TODO: handle existing next +# one implication of handles: append must take a handle +fn append-word _self-ah: (addr handle word) { + var self-ah/esi: (addr handle word) <- copy _self-ah + var self/eax: (addr word) <- lookup *self-ah + var next-ah/eax: (addr handle word) <- get self, next + allocate next-ah + var next/eax: (addr word) <- lookup *next-ah + initialize-word next + var prev-ah/eax: (addr handle word) <- get next, prev + copy-handle *self-ah, prev-ah +} |