Skip to content

Commit 2a1af98

Browse files
committed
📝
1 parent 3f4e2a0 commit 2a1af98

File tree

9 files changed

+154
-234
lines changed

9 files changed

+154
-234
lines changed

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
.github/
12
.vscode/**
23
.vscode-test/**
34
.vscode-test-web/**
45
src/
56
doc/
67
pics/
7-
LICENSE
8+
dev/
89
samples/
910

1011
**/test/**

CHANGELOG.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
1-
# Change Log
1+
# Change Log 更新日志
22

3-
## A VSCode Extension for learning DOS assembly(MASM/TASM) via DOSBox
3+
[email](mailto:xsro@foxmail.com)|[issue](https://github.com/dosasm/masm-tasm/issues)
44

5-
# 0.9.0
5+
## 1.0 Web Extension Support 浏览器端支持
6+
7+
To keep the extension simple, I split the part of interaction with DOS emulator to a new
8+
platform-specified extension [xsro.vscode-dosbox][vscode-dosbox]
9+
10+
- add support for browser, you can use this extension in sites like [vscode.dev][vscode-dev] and [github-dev][github-dev]
11+
- add support for DOS emulator [DOSBox-x][dosbox-x]
12+
- change default emulator to jsdos
13+
- now only support single file DOS assembly, I try to add some multi-file assembly support, but is's confusing for me.
14+
- remove the capture of warning message
15+
- remove command `DOSBox here`
16+
17+
为了保持简洁,我将与DOS模拟器交互的部分独立为一个新的插件[xsro.vscode-dosbox][vscode-dosbox]
18+
19+
- 增加对于浏览器的支持,现在可以在[vscode.dev][vscode-dev][github-dev][github-dev]使用
20+
- 增加对[DOSBox-x][dosbox-x]的支持
21+
- 默认DOS模拟器变更为jsdos
22+
- 移除一些烦人的设置,目前只支持单文件的DOS环境下汇编
23+
- 移除对汇编成功但是有警告信息时显示的界面消息
24+
- 移除命令`DOSBox here`
25+
26+
[vscode-dosbox]: https://marketplace.visualstudio.com/items?itemName=xsro.vscode-dosbox "VSCode DOSBox"
27+
[dosbox-x]: https://www.dosbox-x.com "DOSBox-x"
28+
[github-dev]: https://github.dev
29+
[vscode-dev]: https://vscode.dev
30+
31+
---
32+
33+
## 0.9.0
634

735
- 更新JSDos到[v7](https://js-dos.com/)
836
- 为防止通过状态栏修改了配置但是更改不体现的情况,所以该版本配置直接更新到工作区。

README.md

Lines changed: 60 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,92 @@
1-
# DOS assembly (MASM/TASM) via DOSBox
1+
<img align="right" src="./resources/dosboxasm.png">
2+
3+
# Basic support for MASM/TASM v1.x
24

35
[Chinese](README.zh.md)|[English](README.md)|
4-
[中文 in gitee](https://gitee.com/dosasm/masm-tasm/)|
5-
[more versions](https://github.com/dosasm/masm-tasm/releases)
6+
[中文 in gitee](https://gitee.com/dosasm/masm-tasm/)
67

7-
Language support for DOS assembly,may be suitable for studying MASM/TASM in DOSBox and the course *principles& peripheral technology of microprocessor*.
8+
Basic language support for assembly in **DOS** environment.
9+
may be suitable for studying MASM/TASM in DOSBox
10+
or courses like _principles& peripheral technology of microprocessor_.
811

9-
- (**Language Support**) Offer *grammar*,basic *outline* view,*hover*,*code formate* support for DOS assembly language
10-
- **Run and debug** assembly with right click on the VSCode editor panel. You can choose using MASM or TASM in the preference-settings.
12+
- **Language Support**: Offer _grammar_,basic _outline_ view,_hover_,_code formate_ support for DOS assembly language
13+
- **Run and debug**: Right click on the VSCode editor panel, run and debug your code
1114
- **Diagnose**: process the output of ASM tools and display them in VSCode
12-
- (suitable for all OS) use JS-Dos to run your asm program in VSCode webview
13-
- **For windows**, also support use DOSBox and [MSDOS player](http://takeda-toshiya.my.coocan.jp/msdos). All needed tools have been packaged in the extension. Just install and enjoy!
14-
- [For other systems](#for-other-system): also support DOSBox. You need to install [DOSBox](https://www.dosbox.com) first
15-
- Note: this extension is built for assembly in DOS, so it not works well with assembly for win32
15+
- support all platform including **Web**, see [platform support](#platform-support)
16+
- Note: this extension is built for learning assembly in DOS, it can not work with assembly for win32
1617

1718
## Demo
1819

19-
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/>
20+
### Demo 1: Language Features
21+
22+
| Formate Codes | Diagnose |
23+
| ---------------------------- | -------------------------------- |
24+
| ![](pics/demo_PLFeature.gif) | ![](pics/demo_diagnose_tasm.gif) |
2025

21-
![jsdos demo](pics/demo_jsdos.gif)
26+
The extension offers some language features like "hover","formate","jump to definition" as language id `assembly`.
27+
You can also use other extension for Assembly language Support, for example language ID `asm-collection` by installing extension [ASM Code Lens](https://marketplace.visualstudio.com/items?itemName=maziac.asm-code-lens).
2228

23-
### Demo 1: Run and Debug Assembly
29+
### Demo 2: Run and Debug
2430

25-
| using TASM via DOSBox | using MASM via msdos-player |
26-
| ---------------------------------------------- | --------------------------------------------------- |
27-
| ![demo dosbox tasm](pics/demo_dosbox_tasm.gif) | ![demo msdos-player masm](pics/demo_msdos_masm.gif) |
31+
| using TASM via DOSBox | using MASM via msdos-player |
32+
| ------------------------------ | ----------------------------- |
33+
| ![](pics/demo_dosbox_tasm.gif) | ![](pics/demo_msdos_masm.gif) |
2834

2935
when you are editing `assembly` files ,you can right click at the editor panel,then you will see several choices listed below:
3036

3137
1. **Open Emulator**: Open the dosbox, prepare the environment
3238
2. **Run ASM code**: Assemble,link and Run the program
3339
3. **Debug ASM code**: Assemble,link and Debug the program
3440

35-
**NOTE**:
36-
37-
- 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.
38-
- Default is using `DOSBox` and `TASM`,you can change them in `preference->settings` like the second gif(using MASM via msdos player).
39-
- If you use `include` to include another file or use `extern`, please use `dosbox here`(see demo2)
40-
41-
### Demo 2: Open dosbox and type the command you need
42-
43-
| Single-File (command `Open DOSBox`) | Multi-Files (command `Dosbox here`) |
44-
| -------------------------------------- | -------------------------------------------------------------------------------- |
45-
| ![Open in Dosbox](pics/opendosbox.gif) | [![pacman](pics/demo_pacman.gif)](https://github.com/dpisdaniel/assembly-pacman) |
46-
47-
- 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 `D:`)
48-
- 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.
49-
- some ASM commands you may need: [ASM_commands](https://github.com/dosasm/masm-tasm/wiki/ASM_commands).
50-
- Some interesting assembly codes you may need: [DOSBox ASM codes](https://github.com/dosasm/masm-tasm/wiki/dosbox)
51-
52-
### Demo 3: code Formate,Diagnose and more
41+
#### RunDebug Notes
5342

54-
| Formate Codes | Diagnose |
55-
| ----------------------------------------------------------- | ---------------------------------------- |
56-
| ![programmatic lanaguage features](pics/demo_PLFeature.gif) | ![diagnose](pics/demo_diagnose_tasm.gif) |
43+
- If your code just in a single file, set configuration `masmtasm.ASM.mode` as `single file`. The extension will copy your file to a seperate space in your machine to keep your workspace Folder clean.
44+
- If your project is complex and making up with many files, you may set configuration `masmtasm.ASM.mode` as `workspace` and keep your files' names follow the emulator's limitation.
45+
- Obviously, this extension may be not suitable for complex project
5746

58-
The extension offer some programmatic features like "hover","formate","jump to definition",you can close them in the `preferece->settings`
47+
## Platform Support
5948

60-
## For other system
49+
The extension depend on [vscode-dosbox](https://marketplace.visualstudio.com/items?itemName=xsro.vscode-dosbox) for intergration with DOS emulator.
50+
It has packaged all binary files for windows system.
6151

62-
The extension is packaged with needed [tools](doc/Toolspath.md) 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](https://www.dosbox.com)
52+
Follow [its doc](https://github.com/dosasm/vscode-dosbox#dependency-installation) for installing emulator like DOSBox in other system.
6353

64-
For MacOS (Darwin),the extension will use command `open -a DOSBox --args` to open DOSBox. So you need to:
65-
66-
1. download dmg file from [DOSBox's website](https://www.dosbox.com)
67-
2. Double-click the `.DMG` file to mount it. A new Finder window showing its contents should appear.
68-
3. double-click the mounted volume on your desktop and drag the app icon from there to the “Applications” icon in the Finder sidebar.
69-
70-
For Ubuntu and other linux system user,The extension will use shell command `dosbox` to open DOSBox. We can use command like this:
71-
72-
```sh
73-
sudo apt install dosbox #install dosbox
74-
dosbox #if successfully opened the dosbox, it is largely possible for the extension to use dosbox
75-
```
76-
77-
You can also use the setting ID `masmtasm.dosbox.command` to set your command for the extension to open DOSBox.
78-
79-
## Extension Settings
80-
81-
for more,please see the `preference->settings`
82-
83-
- `masmtasm.ASM.MASMorTASM` use *MASM* or *TASM* assembler in DOS emulator to run and debug assembly
84-
- `masmtasm.ASM.emulator` choose DOS emulator
85-
- `jsdos` (recommend) run in JS-DOS in VSCode's webview
86-
- `DOSBox` (default) more stable
87-
- `msdos player`quiet, it runs in command prompt(CMD). So it cannot support GUI like `TD.exe`
88-
- `auto` use DOSBox and msdos player
89-
1. use msdos-player to compile and link
90-
2. use DOSBox to run
91-
3. use msdos-player for MASM(debug)
92-
4. use DOSBox for TASM(TD)
93-
- `masmtasm.ASM.savefirst` save file first before using
94-
- `masmtasm.dosbox.run`:what to do after run your code in DOSBox
95-
- `masmtasm.ASM.toolspath`: (usually do not need it) use tools from this path, see [about-tools](#about-tools)
96-
- `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:
97-
98-
```jsonc
99-
{
100-
"masmtasm.dosbox.config": {
101-
"SDL.windowresolution": "1024x640",//set the size of the dosbox window
102-
"SDL.output": "opengl"
103-
},
104-
"masmtasm.ASM.toolspath": "E:\\tools"//set the custom ASM tools
105-
}
106-
```
54+
## About DOSBox 's disk
10755

108-
### string replacer
109-
110-
the string replacer for settings `masmtasm.dosbox.more`,`masmtasm.jsdos.more`,`masmtasm.msdos.more`.Extension will replace these strings to relavant value.
111-
112-
| string | replace to |
113-
| --------------- | ------------------------------------------------------------------- |
114-
| `${fullname}` | the fullname of the source code file like`c:\asm\hello.asm` |
115-
| `${filename}` | the filename of the source code file like `hello` |
116-
| `${fileFolder}` | the folder path of the source code file like `c:\asm` |
117-
| `${fileDisk}` | the file disk of the source code file like `c` |
118-
| `${toolpath}` | the folder path of the asm tools including *MASM* and *TASM* folder |
119-
120-
### About DOSBox 's disk
121-
122-
The extension will mount some folder to DOSBox 's disk. Please don't modify them.
56+
The extension will mount some folder to DOSBox 's disk.
12357

12458
| in DOSBox | real path in the computer |
12559
| --------- | -------------------------- |
12660
| C: | the path of tools folder |
12761
| D: | the path of the work space |
12862

129-
## known issues
130-
131-
- lack of support of assembly in not just one file
132-
133-
## About tools
134-
135-
### How the extension use tools
136-
137-
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
138-
139-
See [built-in-tools](tools/README.md)
63+
## Compile to `.com` files
64+
65+
You can change the command to exec in setting `masmtasm.ASM.actions`.
66+
For example, if you want to compile your code to `.com`, you can add a setting like this.
67+
And set `masmtasm.ASM.assembler` to its key `TASM-com`
68+
69+
```json
70+
"masmtasm.ASM.actions": {
71+
"TASM-com": {
72+
"baseBundle": "<built-in>/TASM.jsdos",
73+
"before": [
74+
"set PATH=C:\\TASM"
75+
],
76+
"run": [
77+
"TASM ${file}",
78+
"TLINK /t ${filename}",
79+
"${filename}"
80+
],
81+
"debug": [
82+
"TASM /zi ${file}",
83+
"TLINK /t/v/3 ${filename}.obj",
84+
"TD ${filename}.exe"
85+
]
86+
}
87+
}
88+
"masmtasm.ASM.assembler":"TASM-com"
89+
```
14090

14191
### where-are-extensions-installed
14292

@@ -146,13 +96,9 @@ According to [VSCode-doc](https://code.visualstudio.com/docs/editor/extension-ga
14696
- mac-OS `~/.vscode/extensions`
14797
- Linux `~/.vscode/extensions`
14898

149-
### use your tools
150-
151-
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](tools/)
152-
15399
## Docs & Thanks & Licenses
154100

155-
- Thanks to my teacher *Han*. Hope 2020 and the coming 2021 happy and worthy
101+
- Thanks to my teacher _Han_. Hope 2020 and the coming 2021 happy and worthy
156102
- inspired by [Woodykaixa](https://github.com/Woodykaixa)'s [masm-code](https://github.com/Woodykaixa/masm-code)
157103
- Thanks to excellent DOS emulator: [dosbox](https://www.dosbox.com), [caiiiycuk](https://github.com/caiiiycuk)'s [js dos](https://js-dos.com/) and [msdos player](http://takeda-toshiya.my.coocan.jp/msdos)
158104
- Thanks to [Roncho](https://marketplace.visualstudio.com/publishers/Roncho) 's extension [Assembly (TASM)](https://marketplace.visualstudio.com/items?itemName=Roncho.assembly-8086),[blindtiger](https://github.com/9176324)'s [masm](https://github.com/9176324/bltg-team.masm) for ASM language information

0 commit comments

Comments
 (0)