From ecb9ac7bd82e6a1c77ef8cf7700fd0722870bea6 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 19 Sep 2020 19:44:55 -0700 Subject: 6805 --- apps/tile/word.mu | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'apps/tile/word.mu') 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 +} -- cgit 1.4.1-2-gfad0 nus/orion/tree/'>root/LICENSE
blob: a976f454fac1f1a845b16e621ab843af2f34e4e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13