diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-12-29 00:43:31 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-12-29 00:43:31 +0400 |
commit | 19bd93de75b1a322b7b20c7f861e8b1a582c81fa (patch) | |
tree | 6fb7624d3f43a55e7db9ebb286a1ec966072954f /src | |
parent | f6f4583179ec51ab642e96cda52ebd597919a9a2 (diff) |
`println` function added
Diffstat (limited to 'src')
-rw-r--r-- | src/main.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.go b/src/main.go index b850c8c..183cb84 100644 --- a/src/main.go +++ b/src/main.go @@ -174,9 +174,14 @@ func compile(raw[]string) { print(" syscall") case "println": - /*printout the last element without poping it - the difference between dump is println also prints strings*/ - panic("println: not implemented") + print(" ;; PRINTLN") + print(" pop rsi") + print(" pop rdx") + print(" mov rdi, 1") + print(" mov rax, 1") + print(" syscall") + print(" push rsi") + print(" push rdx") default: panic("invalid word") |