diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-26 21:06:26 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-26 21:06:26 -0700 |
commit | c5b1b560e28e615dac29ea19aa76e5e715f54626 (patch) | |
tree | b971072b2449d870c201412424d97c8383fe83f9 /apps/tile | |
parent | 14a41f4a27dee7f4b149090ae93e04184c39393b (diff) | |
download | mu-c5b1b560e28e615dac29ea19aa76e5e715f54626.tar.gz |
7113
Diffstat (limited to 'apps/tile')
-rw-r--r-- | apps/tile/environment.mu | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu index 09a0b434..e8221a34 100644 --- a/apps/tile/environment.mu +++ b/apps/tile/environment.mu @@ -786,6 +786,14 @@ fn bound-function? w: (addr word), functions-ah: (addr handle function) -> resul subresult <- word-equal? w, "read" compare subresult, 0 # false break-if-!= + # if w == "dup" return true + subresult <- word-equal? w, "dup" + compare subresult, 0 # false + break-if-!= + # if w == "swap" return true + subresult <- word-equal? w, "swap" + compare subresult, 0 # false + break-if-!= # return w in functions var out-h: (handle function) var out/eax: (addr handle function) <- address out-h @@ -1542,13 +1550,15 @@ fn clear-canvas _env: (addr environment) { start-col <- subtract 0x18 move-cursor screen, 1, start-col print-string screen, "primitives:" - move-cursor screen, 4, start-col + move-cursor screen, 5, start-col print-string screen, "functions:" start-col <- add 2 move-cursor screen, 2, start-col print-string screen, "+ - * len open read" + move-cursor screen, 3, start-col + print-string screen, "dup swap" # currently defined functions - var row/ebx: int <- copy 5 + var row/ebx: int <- copy 6 var functions/esi: (addr handle function) <- get env, functions { var curr/eax: (addr function) <- lookup *functions |