initial snap
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 12 May 2021 03:37:41 +0000 (13:37 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 12 May 2021 03:37:41 +0000 (13:37 +1000)
Makefile [new file with mode: 0644]
main.fasm [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..012248a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+BINARY = rrqforth
+
+rrqforth: main.fasm
+       fasm $^ $@
+
diff --git a/main.fasm b/main.fasm
new file mode 100644 (file)
index 0000000..6bd525a
--- /dev/null
+++ b/main.fasm
@@ -0,0 +1,21 @@
+; This is a program
+       format elf64 executable
+       entry main
+
+       segment readable executable
+       msg db 'hello world.'
+       db 10
+       length = $ - msg
+
+main:
+       lea rsi,[msg]           ; address of message
+       mov edx,length          ; length od trdting
+       mov edi,1               ; stdout
+       mov eax,1               ; sys_write
+       syscall
+
+fini:
+       xor edi,edi
+       mov eax,60
+       syscall
+