TURING COMPLETE!
This commit is contained in:
@@ -99,6 +99,18 @@ handleSymbol h (ZorthASTWord "dup") = do
|
||||
\ push rax\n"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord "display") = do
|
||||
liftIO $ hPutStr h
|
||||
" push rsp\n\
|
||||
\ mov rbp, rsp\n\
|
||||
\ mov rax, 1\n\
|
||||
\ mov rdi, 1\n\
|
||||
\ mov rsi, [rbp]\n\
|
||||
\ mov rdx, 1\n\
|
||||
\ syscall\n\
|
||||
\ pop rsp\n\
|
||||
\ add rsp, 8\n"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord "mem") = do
|
||||
liftIO $ hPutStr h
|
||||
@@ -172,7 +184,7 @@ handleSymbol h (ZorthASTWord "<=") = do
|
||||
|
||||
handleSymbol h (ZorthASTWord w) = do
|
||||
state <- get
|
||||
liftIO $ compileZorthAST h ((environment state) M.! w) state -- parent env to child and discard
|
||||
_ <- compileZorthASTState h ((environment state) M.! w) -- parent env to child and discard
|
||||
return ()
|
||||
|
||||
handleSymbol _ (ZorthASTWordDecl (name,ast)) = do
|
||||
|
||||
Reference in New Issue
Block a user