diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-25 21:33:24 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-25 21:35:24 -0700 |
commit | 5f5579e1682fbcea3340a036ef57684cacb835e4 (patch) | |
tree | ac5798c83cca7f5d5fe86d1aba954ebd5c7e0abd /apps/tile/value-stack.mu | |
parent | 2d7960d493c11ba6286193ec01b7f6771cd0b695 (diff) | |
download | mu-5f5579e1682fbcea3340a036ef57684cacb835e4.tar.gz |
7107 - tile: file handles
Diffstat (limited to 'apps/tile/value-stack.mu')
-rw-r--r-- | apps/tile/value-stack.mu | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/tile/value-stack.mu b/apps/tile/value-stack.mu index dbe25b74..2eae94d3 100644 --- a/apps/tile/value-stack.mu +++ b/apps/tile/value-stack.mu @@ -176,6 +176,19 @@ fn value-stack-max-width _self: (addr value-stack) -> result/eax: int { break-if-<= copy-to out, w } + { + compare *type, 3 # file handle + break-if-!= + var f-ah/eax: (addr handle buffered-file) <- get g, file-data + var f/eax: (addr buffered-file) <- lookup *f-ah + compare f, 0 + break-if-= + # TODO + var w/eax: int <- copy 4 + compare w, out + break-if-<= + copy-to out, w + } i <- increment loop } |