diff options
Diffstat (limited to 'shell/cell.mu')
-rw-r--r-- | shell/cell.mu | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/cell.mu b/shell/cell.mu index 1aed590d..11a16821 100644 --- a/shell/cell.mu +++ b/shell/cell.mu @@ -10,6 +10,8 @@ type cell { text-data: (handle stream byte) # type 4: primitive function index-data: int + # type 5: screen + screen-data: (handle screen) # TODO: array, (associative) table, stream } @@ -114,3 +116,20 @@ fn new-primitive-function out: (addr handle cell), n: int { allocate-primitive-function out initialize-primitive-function out, n } + +fn allocate-screen _out: (addr handle cell) { + var out/eax: (addr handle cell) <- copy _out + allocate out + var out-addr/eax: (addr cell) <- lookup *out + var type/ecx: (addr int) <- get out-addr, type + copy-to *type, 5/screen +} + +fn new-screen _out: (addr handle cell), width: int, height: int { + var out/eax: (addr handle cell) <- copy _out + allocate-screen out + var out-addr/eax: (addr cell) <- lookup *out + var dest-ah/eax: (addr handle screen) <- get out-addr, screen-data + var dest-addr/eax: (addr screen) <- lookup *dest-ah + initialize-screen dest-addr, width, height +} |