removed (this isn't C, after all)

This commit is contained in:
2025-09-07 19:00:35 +01:00
parent cd527903c2
commit 16700541e6
3 changed files with 8 additions and 12 deletions

View File

@@ -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"

View File

@@ -23,5 +23,3 @@ while
fi
1+
repeat
ret

View File

@@ -16,5 +16,3 @@
;
15 fib
ret