DOS assembly (MASM/TASM) via DOSBox
中文 in gitee|
Language support for DOS assembly,may be suitable for studying MASM/TASM in DOSBox and the course principles& peripheral technology of microprocessor.
- (Language Support) Offer grammar,basic outline view,hover,code formate support for DOS assembly language
- Run and debug assembly with right click on the VSCode editor panel. You can choose using MASM or TASM in the preference-settings.
- Diagnose: process the output of ASM tools and display them in VSCode
- (suitable for all OS) use JS-Dos to run your asm program in VSCode webview
- For windows, also support use DOSBox and MSDOS player. All needed tools have been packaged in the extension. Just install and enjoy!
- For other systems: also support DOSBox. You need to install DOSBox first
- Note: this extension is built for assembly in DOS, so it not works well with assembly for win32
Now the extension supports using JSDos to run wdosbox in VSCode's Webview. Change the
masmtasm.ASM.emulator in settings to jsdos to try it. And I am trying to make the extension more friendly to nice project like http://blog.swishscripts.com/2021/02/11/cloning-nes-tetris-in-x86-16-bit-assembly-part-1/
Demo 1: Run and Debug Assembly
|using TASM via DOSBox
||using MASM via msdos-player
when you are editing
assembly files ,you can right click at the editor panel,then you will see several choices listed below:
- Open Emulator: Open the dosbox, prepare the environment
- Run ASM code: Assemble,link and Run the program
- Debug ASM code: Assemble,link and Debug the program
- If your files path is not workable for emulator. The extension will copy your file in active editor to a separate workspace and operate it there.
- Default is using
TASM,you can change them in
preference->settings like the second gif(using MASM via msdos player).
- If you use
include to include another file or use
extern, please use
dosbox here(see demo2)
Demo 2: Open dosbox and type the command you need
- Editor Command "
Open Emulator":Open emulator at your file's folder. If your file's path is not readable for DOS emulator, your file will be copied as
T.ASM in DOS emulator. (For DOSBox, copy your file to work space folder and mount this folder to DOSBox disk
- Command "
Doxbox here": The extension will Open DOSBox and mount your active editor file's folder directly to DOSBox 's disk
D: with no path-checking.
- some ASM commands you may need: ASM_commands.
- Some interesting assembly codes you may need: DOSBox ASM codes
Demo 3: code Formate,Diagnose and more
The extension offer some programmatic features like "hover","formate","jump to definition",you can close them in the
For other system
The extension is packaged with needed tools for windows inside while other OS users should make sure DOSBox can be opened by shell command. We can download DOSBox from its website:DOSBox
For MacOS (Darwin),the extension will use command
open -a DOSBox --args to open DOSBox. So you need to:
- download dmg file from DOSBox's website
- Double-click the
.DMG file to mount it. A new Finder window showing its contents should appear.
- double-click the mounted volume on your desktop and drag the app icon from there to the “Applications” icon in the Finder sidebar.
For Ubuntu and other linux system user,The extension will use shell command
dosbox to open DOSBox. We can use command like this:
sudo apt install dosbox #install dosbox
dosbox #if successfully opened the dosbox, it is largely possible for the extension to use dosbox
You can also use the setting ID
masmtasm.dosbox.command to set your command for the extension to open DOSBox.
for more,please see the
masmtasm.ASM.MASMorTASM use MASM or TASM assembler in DOS emulator to run and debug assembly
masmtasm.ASM.emulator choose DOS emulator
jsdos (recommend) run in JS-DOS in VSCode's webview
DOSBox (default) more stable
msdos playerquiet, it runs in command prompt(CMD). So it cannot support GUI like
auto use DOSBox and msdos player
- use msdos-player to compile and link
- use DOSBox to run
- use msdos-player for MASM(debug)
- use DOSBox for TASM(TD)
masmtasm.ASM.savefirst save file first before using
masmtasm.dosbox.run：what to do after run your code in DOSBox
masmtasm.ASM.toolspath: (usually do not need it) use tools from this path, see about-tools
masmtasm.dosbox.config: set the DOSBox configuration. The setting will be write to a
.conf file which will be used by the DOSBox launched by the extension. Set the configuration like below:
"SDL.windowresolution": "1024x640",//set the size of the dosbox window
"masmtasm.ASM.toolspath": "E:\\tools"//set the custom ASM tools
the string replacer for settings
masmtasm.msdos.more.Extension will replace these strings to relavant value.
|the fullname of the source code file like
|the filename of the source code file like
|the folder path of the source code file like
|the file disk of the source code file like
|the folder path of the asm tools including MASM and TASM folder
About DOSBox 's disk
The extension will mount some folder to DOSBox 's disk. Please don't modify them.
||real path in the computer
||the path of tools folder
||the path of the work space
- lack of support of assembly in not just one file
The extension will use the tools in the extension's folder
tools. If defined the setting
masmtasm.ASM.toolspath, the extension will use ASM tools in this folder instead. This may cause problem
According to VSCode-doc, the extension will be installed in following folder:
if you want to use your tools of assembler, please paste your path to the setting
masmtasm.ASM.toolspath, your files should follow the structure like tools
Docs & Thanks & Licenses