Okay, so what I ended up doing was searching around the bin
folder of my MASM32 installation, where I found the assembler: ml.exe
. I then write assembly to a text file and invoke the assembler on it using: Runtime.exec()
:
Runtime.getRuntime().exec(
"C:/masm32/bin/ml.exe " //directory of assembler
+"/coff " //create COFF header (needed for Win32)
+"/Bl C:/masm32/bin/link.exe " //directory of linker
+"/Fe src/" + fileName + ".exe " //executable file
+"/Fo src/" + fileName + ".obj " //object file
+ fileName + ".asm"); //assembly file (source)
User n.m. gave me the idea, but as they didn't post it as answer after a month I decided to just answer it myself.