summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2023-10-23 22:27:47 +1100
committerNicholas Tay <nick@windblume.net>2023-10-23 22:27:47 +1100
commitfe6a4294a88edd762b2d7a6c67bd8bea7c29f3de (patch)
tree9407c14271e7777848b5ccfa19b3e96088695252
parentcd646947074a1793d2d9d7ba556853f92be0bab2 (diff)
downloadpasmgen-fe6a4294a88edd762b2d7a6c67bd8bea7c29f3de.tar.gz
pasmgen-fe6a4294a88edd762b2d7a6c67bd8bea7c29f3de.tar.bz2
pasmgen-fe6a4294a88edd762b2d7a6c67bd8bea7c29f3de.zip
Add Windows port
-rw-r--r--build.bat4
-rw-r--r--pasmgen-win.asm35
2 files changed, 39 insertions, 0 deletions
diff --git a/build.bat b/build.bat
new file mode 100644
index 0000000..9c8d76b
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,4 @@
+set FASMDIR=C:\Tools\fasm
+
+set INCLUDE=%FASMDIR%\INCLUDE
+%FASMDIR%\fasm .\pasmgen-win.asm
diff --git a/pasmgen-win.asm b/pasmgen-win.asm
new file mode 100644
index 0000000..c65c47b
--- /dev/null
+++ b/pasmgen-win.asm
@@ -0,0 +1,35 @@
+format PE64 console
+
+include 'win64a.inc'
+
+
+section '.text' code readable executable
+
+entry main
+main:
+ mov r8, qword 3
+ mov r9, qword 2
+ mov r10, qword 3
+
+ jmp generate
+
+ok:
+ invoke GetStdHandle, STD_OUTPUT_HANDLE
+ invoke WriteConsole, rax, out_buf, rsi, 0, 0
+ invoke ExitProcess, 0
+
+include 'pasmgen.inc'
+
+
+;; win32 imports
+section '.idata' import data readable
+
+library kernel32,'kernel32.dll'
+include 'api/kernel32.inc'
+
+
+section '.data' data readable writeable
+
+include 'constants.inc'
+
+out_buf rb 64