diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-19 19:44:55 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-19 19:44:55 -0700 |
commit | ecb9ac7bd82e6a1c77ef8cf7700fd0722870bea6 (patch) | |
tree | cb3e788ed74b1537d7d9064a1b3be7aad968fb69 /apps/tile/word.mu | |
parent | a553a5e201b347f4ecc5f0fd9956fb083f941c86 (diff) | |
download | mu-ecb9ac7bd82e6a1c77ef8cf7700fd0722870bea6.tar.gz |
6805
Diffstat (limited to 'apps/tile/word.mu')
-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 +} |