From fe6a4294a88edd762b2d7a6c67bd8bea7c29f3de Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Mon, 23 Oct 2023 22:27:47 +1100 Subject: Add Windows port --- build.bat | 4 ++++ pasmgen-win.asm | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 build.bat create mode 100644 pasmgen-win.asm 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 -- cgit