Giter Site home page Giter Site logo

dosasm / masm-tasm Goto Github PK

View Code? Open in Web Editor NEW
148.0 148.0 23.0 18.05 MB

run and debug TASM/MASM code in VSCode via JSDos, DOSBox and msdos-player

Home Page: https://marketplace.visualstudio.com/items?itemName=xsro.masm-tasm

License: MIT License

TypeScript 92.60% JavaScript 4.51% Assembly 0.62% HTML 1.10% CSS 0.56% Shell 0.25% C 0.36%
8086 assembly dos dosbox masm tasm vscode vscode-extension

masm-tasm's Introduction

DOSASM Website

This is website for docs, notes for DOSASM deployed in github and gitee.

for notes, go to following link

This website is built using Docusaurus 2, a modern static website generator.

Installation

yarn install

Local Development

yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.

masm-tasm's People

Contributors

xsro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

masm-tasm's Issues

How to include a macro?

Hi.
Thanks a lot for this nice extension. I'm not able to include a macro file, the extension always terminates the Run ASM code command, with an error: can't locate file: name.inc

`include mac.inc
.model small
.stack 64
.data
msg db "hello","$"

.code

main proc far
mov ax,@DaTa
mov ds,ax

mov ah,9
mov dx,offset msg
int 21h
hlt
main endp
end main

`
Can't locate file: mac.inc

MASM-TASM怎么更改颜色

我想问一下有没有什么方法可以更改您制作的MASM-TASM的配色方案。我想在其中加一些自己个性化的方案。不知道方不方便透露一下修改的方法。

Dosbox无法挂载含有特殊字符的路径

Dosbox对特殊字符的支持效果比较差,本插件通过一些手段试图规避这个问题,但是有些地方仍然并不如意。

  1. Dosbox挂载的时候,无法挂载带有中文的路径地址,比如命令mount d d:\文件夹无法工作
  2. Dosbox读写文件的时候,文件路径必须没有中文,比如命令type 你好.txt就无法读取文件

我通过cmd将文件复制到插件安装 目录再使用的方式来规避【2】,但是如果插件的安装路径中有中文就无法顺利mount挂载,由于常常有使用特殊字符作为用户名的情况,这往往是致命的

目前我的大部分文件是和插件放在一起的,

  • 这个位置通常为%USERPROFILE%.vscode\extensions(比如:C:\Users\用户名\.vscode\extensions,当用户名有中文的时候这个路径就无法被dosbox访问),
  • 假如使用vscode提供的globalstorage(如C:/Users/用户名/AppData/Roaming/Code/User/globalStorage/kaixa.masm-code/)也有这样的问题。

有没有什么好的方法解决这个问题

用户层面解决

  • 假如vscode安装路径没有中文的话,可以在vscode安装位置文件夹下新建一个data文件夹,vscode会把插件等内容存放在这里

代码层面解决

📖用gbk编码保存配置文件,或者使用dosbox参数传递命令。0.3.1中使用了后者,但是仍然有问题

关于工作目录的挂载问题

原本是想请求作者能够将代码挂载在当前工作目录而非插件下的workspace。
但是刚刚得知dos挂载存在着目录字符限制问题。
但是如果无法实时更新文件内容,那么就意味着每次本地修改都要关闭窗口并”重新打开DOS环境“。
所以能否考虑一种折中的手段,就是每次保存文件都进行一次从工作目录到挂载目录的文件复制?

Cannot read properties of undefined (reading 'fsPath')

  1. Ctrl + Shift + p
  2. 'debug asm code'
  3. error:
    image

log info:
image

[2022-05-15 02:24:50.749] [exthost] [error] TypeError: Cannot read properties of undefined (reading 'fsPath')
at c:\Users\user.vscode-insiders\extensions\xsro.masm-tasm-1.1.0\dist\extension.js:1:46204
at c:\Users\user.vscode-insiders\extensions\xsro.masm-tasm-1.1.0\dist\extension.js:1:45130

File not found error

When I attempt to include a file in my ASM program, the compiler Can't locate file. For example:

    sound_data:
        INCLUDE  "kingsv.wav" ; 51.529 bytes		

Note that my .asm file and kingsv.wav file are in the same directory (root directory)

I have also changed the setting Masmtasm.ASM working mode to workspace

Have I missed anything? Thanks

Ability to chose in what type to compile in .COM or into .EXE

It would be great if you can chose in what type to compile your source file into .COM or into .EXE file
I know you can do what using Emulator button and type command to compile but still it a lot of annoying work. Can you automate it ? Or add parameter to chose whenever compile into .COM or into .EXE?

Also how to run what pretty debugger (RUN ASM DEBUGGER button ) instead of using td debugger when you compile multy source project?

Multiple file assembly support

In assembly language, there are some directives related to multiple file assembly like : include
includelib

For example, include test.asm We need to find file named test.asm in the current folder. Should we find other files like the ones in PARH?

Any plan for supporting bare-metal x86 (or x64) development?

Is there any possibility of adding NASM as an assembler, Bochs / QEMU as emulators in order to provide bare-metal x86 (x64) development and debugging experience?
As NASM is quite a quick and dirty choice for bare-metal development / learning, it's much easier for a beginner (like me) to jump in compared to MASM (or TASM maybe? I don't know that much), also it comes with a wide-range platform support.
QEMU / Bochs may be more suitable for bare-metal emulation and/or debugging.

open dosbox without window of CMD

open DOSBox without window of CMD

在启动DOSBox的时候命令:dosbox.exe -noconsole就不会显示启动的命令行了.
在DOSBox.ts文件的22和40行的dosbox.exe处加上"-noconsole".

let wincommand = 'start/min/wait "" "' + conf.path + '/dosbox/dosbox.exe" -noconsole -conf "' + conf.dosboxconfuri.fsPath + '" ';

关于几个bug

首先还是非常感谢插件的作者。这款插件也是我上微原课,微原老师极力推荐的,也给我学习微原和汇编提供了很大的帮助。所以我想为该插件留下一些建议。

下面是我在使用新版本插件的时候发现的一些bug:

  • 无法格式化代码,或者进行格式化的时候会把操作数疯狂复制
  • (不知道这个算不算bug)DOSbox打开TASM的debug的界面,默认只显示Module/File窗口和Watches窗口,而Regs、Dump窗口默认不显示,需要手动打开(老版本插件进入td界面是默认显示上述4个窗口的)

我用的是老版本vscode,安装插件最高只安装到0.7.0版本的,而0.7.0版本各功能都十分正常。上述bug是我在别的机子用新版vscode(默认安装更新版本的插件)的时候发现的。也不知道是从哪个版本开始有了上述的bug。
另外,我在研究该插件的时候发现使用TD之前插件会将tools\tasm\TDC2.TD复制到workspace里并改名为TDCONFIG.TD,然后在TD的时候才能正常默认显示上述4个窗口(0.7.0版本插件)。我尝试将workspace中的TDCONFIG.TD删除,并手动TD T.EXE,发现debug界面也没有默认显示上述4个窗口(甚至默认显示的是别的窗口)。所以我猜测上述第2点和TDCONFIG.TD这个文件有关?

我还没有学习过插件的制作,很抱歉暂时无法提供代码上的帮助。以后我学习了相关的编程语言后一定会来帮助编写!!

英语不好,就不用英语写了(

collect ASM keyword information

The extension mainly designed for x86 assembly (TASM/MASM)

How can I collect and classify the keyword information

according to wikipedia, there are:

  • Opcode mnemonics: (操作码助记符) Generally, a mnemonic is a symbolic name for a single executable machine language instruction (an opcode), and there is at least one opcode mnemonic defined for each machine language instruction. Each instruction typically consists of an operation or opcode plus zero or more operands.
  • Data definitions: (数据定义指令)instructions used to define data elements to hold data and variables
  • Assembly directives:( 汇编伪指令)Assembly directives, also called pseudo-opcodes, pseudo-operations or pseudo-ops, are commands given to an assembler "directing it to perform operations other than assembling instructions"

Irvine32.inc file not found

I was working on a project in Assembly and I needed to call the library Irvine32.inc but I found out that the program is isolating the executable file which is in dosbox from the real hard disk, changed the type as workspace but I couldn't handle it.

代码被格式化为错误的结果

我尝试格式化如下代码,但被格式化为了非预期的结果,如下gif所示,正确的段名应为.data而非..data
screenshots

尝试进行格式化的代码

.model small
.STACK 1024
.data
	message db 8 dup(?),0dh,0ah,"$"
.code
	main:    mov  ax,@data         	;主程序开始
	         mov  ds,ax
	         mov  al,"A"           	;子程序参数1
	         mov  si,offset message	;子程序参数2
	         call BinToAsc         	;调用子程序BinToAsc
	         mov  ah,9
	         mov  dx,offset message
	         int  21h              	;显示字符串
	         mov  ax,4c00h
	         int  21h              	;主程序结束

BinToAsc PROC                  		;子程序开始
	         push cx
	         push si
	         mov  cx,8
	L1:      shl  al,1             	;逻辑左移
	         mov  BYTE PTR [si],"0"
	         jnc  L2               	;CF=0则跳转
	         mov  BYTE PTR [si],"1"
	L2:      inc  si
	         loop L1
	         pop  si
	         pop  cx
	         ret
BinToAsc ENDP                  		;子程序结束
		 end main

"Debug ASM code" not working

Greetings, After a while extensions debugger do not work it just compiles/links program and runs exe . no debugger launching.
you can still use using td debugger the emulator button(you need also compile exe file)
Tried reinstall extension but still same error
also using extension for git version

VS version - 1.53 (in previous version also did not worked)
OS - windows 10 x64

code of program for tests, uses graphic mode and displays data

;prints data from vector into console using graphics
;white bg and yellow symbol if for odd numbers
;white bg and green symbol is for even numbers
;black bg and red symbol is for zero

.model small
.data 
W_BG_Y_SYM Equ 01111110b ; white background, yellow symbol	; odd
W_BG_G_SYM Equ 01110010b ; white background, green symbol ;even
BLACK_BG_R_SYM Equ 0000100b; bkack bg and red foreground	;zero
BLACK_BG_W_SYM	Equ 0000111b;for splitter sign

M    Equ    3 ;colons
Vector    DW    12 ,3, 0
.code
.startup
	mov	ax, 13	; row
	mov	bx, 39	; col

	; calculate offset of the position in the video memory 
	dec	ax	; row-1
	mov	dl, 80	; 
	imul	dl	; (row-1)*80
	dec	bx	; col-1
	add	ax, bx	; (row-1)*80 + (col-1)
	add	ax, ax	; *2

	; set address 
	mov	bx, 0B800h
	mov	es, bx	; segment value for text mode video memory
	mov	di, ax	; calculated offset
 
	; write symbols and attributes
    mov bx,0
    mov cx,M
    ;BE AWARE DI+BX CAN ONLY BE TO INCRASE INDEX REGISTER OTHERWISER ERROR!
loopec:
	mov ax,Vector[bx]	
;--if value is zero
	cmp ax,0
	jne check_on_even
	add ax,48 ;convert into char
	mov	word ptr es:[di+BX], ax
	mov	word ptr es:[di+BX+1], BLACK_BG_R_SYM 

	jmp next
;--if value is even
check_on_even:
	test ax,1
	jnz number_is_odd
	add ax,48 ;convert into char W_BG_G_SYM
	mov	word ptr es:[di+BX], ax
	mov	word ptr es:[di+BX+1], W_BG_G_SYM ; white background, yellow symbol
	jmp next
;-- if val is odd
number_is_odd:
	add ax,48 ;convert into char
    mov	word ptr es:[di+BX], ax
	mov	word ptr es:[di+BX+1], W_BG_Y_SYM ; white background, yellow symbol
next:
	add bx,2
   loop loopec
	xor ax,ax
.exit
end

pressing run debugger
running_debugger

output then run RUN ASM DEBUGGER
output_of_then_run_debug

About assembler tools

汇编工具似乎有许多,从比较原始的MASM、TASM到现在的MASM32,GASM,我有些迷惑我应该如何组织这些工具了

我目前使用的是比较原始的MASM和TASM工具,使用dosbox进行模拟,并把win下的dosbox程序打包在插件中,对于其他系统而言并没有这个必要,我在想是否可以在程序中自动检测系统并在win下下载dosbox和msdos。

jle and jge wrong

image
jle is Jump if less or equal,but the extension call it greater or equal.What's more,jge is supposed to be greater or equal,but the extension call it less or equal.
jle本来应该是小于等于,但是插件提示的是不小于。jge本来该是不小于,插件提示的是不大于。

格式化时文件被还原

如题。我开启了 VSC 的“Format On Save”功能,然后惊讶地发现代码无法保存了,每次保存都会回到未修改之前的样子。排查后发现好像是插件的格式化功能存在问题,目前只能先关闭“Format On Save”功能手动保存后再格式化代码,希望能够解决。

About required VSCode version of this extension

Hello,
First, thank you for providing such a convenient extension!

I think that VSCode version requirements could be reduced to ^1.46.0 or even lower. And the relevant code could be modified before packaging to .vsix.

I manage to install this extension directly for my Visual Studio Code 1.46.1, but the extension is failed to install.
Then I download the vsix package, and I modified ^1.47.0 to ^1.46.0, and it is installed successfully. (I directly put the unzipped directory to .vscode folder to install this extension.)

yours sincerely,
@WMF1997

Review usage of workspaceContains activationEvent

Hi, I'm reaching out to let you know that we are fixing a bug with the workspaceContains VS Code extension activationEvent that could change the activation behavior for your extension.

Here's the issue: This event is supposed to start a search in the user's workspace with the given glob pattern. A pattern like *.txt should activate the extension whenever the root of the workspace has a file matching *.txt, but it should not search the entire workspace. A pattern like **/*.txt should recursively search the entire workspace. We discovered that VS Code is incorrectly applying the ** pattern to every workspaceContains pattern that includes a *.

Since this may impact the startup performance of VS Code, we need to scope these searches correctly. Once we fix this, a pattern like *.txt will only match a .txt file in the root of the workspace.

The change will be in VS Code Insiders in early January. It will be released with 1.53 in early February. Please see microsoft/vscode#110510 for more details and let me know if you have any questions.

I

I have trouble that when I choose the 'jsdos' it will just display 'loading' on the right.
G5{DKUG 8`DQ%C (%KRB9S4

插件无法在VSCode Remote下执行启动dosbox模拟器的命令

系统环境:

VSCode: 1.53.2
VSCode运行系统: Windows 10 20H2
VSCode Remote连接至的系统: Ubuntu 20.04.2 LTS x86_64
Ubuntu上的dosbox版本: 0.74-3
shell版本: fish 3.1.0

错误现象:

在右键编辑器选择"Open Emulator"、"Run ASM Code"或"Debug ASM Code"时,若Emulator设置为"dosbox",则上述操作均会直接返回如图错误 exitcode 1(图中为运行"Run ASM Code"时的错误信息):
Snipaste_2021-03-01_09-38-30
然而如果将错误信息中的命令直接复制到shell中运行,则是可以运行的(图中dosbox为X11转发至本机的窗口)
Snipaste_2021-03-01_09-39-17

如果使用jsdos模拟器,则可以正常进行上述操作,msdos-player无法在Linux系统下运行所有没有测试。

bug report: Format Document function

很感谢作者写了自动格式化的功能,但是有bug:多次按下Format Document之后,各语句最后一个操作数会被再写一遍

Todo

Plans📖

Working 🏃‍♀️

  • dosbox: provide virtual workspace
  • add more commands like assemble, link, list
  • a simple debug feature powered by jsdos and masm debugger.exe
  • upgrade node-fetch dependency to v3.x

Long Term Goals 🥅

Run and Debug

  • more friendly problem information display
  • support multi-file assembly
  • offer a basic debug feature. I want to spawn MASM's debug.exe to do this. I need more research

Language Features Enhancement

  • Hover: offer port address description, interrupt command description and more
  • Symbol: offer the Rename Symbol feature
  • improve language configurations and syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.