VisualMASM icon indicating copy to clipboard operation
VisualMASM copied to clipboard

Add support for DOSBox or something similar?

Open djalilhebal opened this issue 5 years ago • 1 comments

In my university, we use 16-bit MASM, and for some reason, we need to use DOSBox and other tricks to get our programs to work... This is what I've suggested to my colleagues to make 16-bit programs work. Surely, there must be a better way to do this.

REM For a better MASM16 development envirornment~~~
REM Tested on/with Windows 10 Pro x64, VisualMASM x32 v2.00, DOSBox x32 v0.74

REM Supposing you've installed DOSBox and are using VisualMASM's default settings
REM From VisualMASM's toolbar, select "Project > Options > Link Events > Post-link"
REM then copy and past this one liner:
cmd /C ""C:\Program Files (x86)\DOSBox-0.74\dosbox.exe" "%CD%\Projects\Program\Release\program.exe" -noconsole -c "cls"" && exit

REM Now, to run MASM16 programs, simply click 'build' or 'run' and DOSBox will start...
REM PS: You're a big boy/girl, in case your paths are different, change them by yourself!

REM ====================<< EXPLANATION SORTA >>====================

REM This longer version is easier to understand and edit.
REM It works fine with CMD, but not with VisualMASM's post-link thing, I wonder why...

rem Path to DOSBox
rem it can be different depending on your software versions, may need to be edited.
SET dosbox="C:\Program Files (x86)\DOSBox-0.74\dosbox.exe"
rem The 16-bit resulting program (this is its default path)
rem (%CD% refers to VisualMASM's Current working Directory)
SET program="%CD%\Projects\Program\Release\program.exe"
rem Command to open that program with DOSbox. Also, hide its console and clear its logo.
rem To better tweak DOSBox read its documentation or manual.
SET command="%dosbox% %program% -noconsole -c "cls""
rem To better tweak the CMD, check `cmd /?` and `start /?`
rem Run it
cmd /C %command%
rem Done executing the program, exit now
rem (Again, for some reason, VisualMASM doesn't close the post-link console.)
exit

djalilhebal avatar Oct 04 '18 21:10 djalilhebal

I will have to take a look and see if I can make this work better. Thank you for your comment.

ThomasJaeger avatar Oct 20 '18 20:10 ThomasJaeger