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" \ push rax\n"
return () 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 handleSymbol h (ZorthASTWord "dup") = do
liftIO $ hPutStr h liftIO $ hPutStr h
" pop rax\n\ " pop rax\n\
@@ -138,6 +131,10 @@ handleSymbol h (ZorthASTWord "=") = do
liftIO $ truthOperator h "sete" liftIO $ truthOperator h "sete"
return () return ()
handleSymbol h (ZorthASTWord "/=") = do
liftIO $ truthOperator h "setne"
return ()
handleSymbol h (ZorthASTWord ">") = do handleSymbol h (ZorthASTWord ">") = do
liftIO $ truthOperator h "setg" liftIO $ truthOperator h "setg"
return () return ()
@@ -224,3 +221,6 @@ compileZorth _ [] = return ()
compileZorth h xs = do compileZorth h xs = do
forthPrelude h 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 fi
1+ 1+
repeat repeat
ret

View File

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