initial
This commit is contained in:
4
zorth.hs
4
zorth.hs
@@ -106,7 +106,7 @@ parseZorth = fst . head . runParser pZorth
|
||||
|
||||
handleSymbol :: ZorthAST -> IO ()
|
||||
handleSymbol (ZorthASTInteger i) = void $ printf " push %d\n" i
|
||||
handleSymbol (ZorthASTWord "_") = do
|
||||
handleSymbol (ZorthASTWord "+") = do
|
||||
putStrLn " pop rbx"
|
||||
putStrLn " pop rax"
|
||||
putStrLn " add rax, rbx"
|
||||
@@ -131,7 +131,7 @@ handleSymbol (ZorthASTWord "swap") = do
|
||||
putStrLn " push rbx"
|
||||
handleSymbol (ZorthASTWord "drop") = do
|
||||
putStrLn " add rsp, 8"
|
||||
handleSymbol (ZorthASTWord "печать") = do
|
||||
handleSymbol (ZorthASTWord ".") = do
|
||||
putStrLn " pop rbx"
|
||||
putStrLn " call print_number"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user