removed (this isn't C, after all)
This commit is contained in:
@@ -92,13 +92,6 @@ handleSymbol h (ZorthASTWord "/") = do
|
||||
\ push rax\n"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord "ret") = do
|
||||
liftIO $ hPutStr h
|
||||
" mov rax,60\n\
|
||||
\ mov rdi,0\n\
|
||||
\ syscall\n"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord "dup") = do
|
||||
liftIO $ hPutStr h
|
||||
" pop rax\n\
|
||||
@@ -138,6 +131,10 @@ handleSymbol h (ZorthASTWord "=") = do
|
||||
liftIO $ truthOperator h "sete"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord "/=") = do
|
||||
liftIO $ truthOperator h "setne"
|
||||
return ()
|
||||
|
||||
handleSymbol h (ZorthASTWord ">") = do
|
||||
liftIO $ truthOperator h "setg"
|
||||
return ()
|
||||
@@ -223,4 +220,7 @@ compileZorth :: Handle -> ZorthAST -> IO ()
|
||||
compileZorth _ [] = return ()
|
||||
compileZorth h xs = do
|
||||
forthPrelude h
|
||||
compileZorthAST h xs $ Environment 0 M.empty
|
||||
compileZorthAST h xs $ Environment 0 M.empty
|
||||
hPutStr h " mov rax,60\n\
|
||||
\ mov rdi,0\n\
|
||||
\ syscall\n"
|
||||
@@ -23,5 +23,3 @@ while
|
||||
fi
|
||||
1+
|
||||
repeat
|
||||
|
||||
ret
|
||||
@@ -16,5 +16,3 @@
|
||||
;
|
||||
|
||||
15 fib
|
||||
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user