Skip to content

Commit 32c1239

Browse files
committed
update project settings
1 parent c2b2dad commit 32c1239

File tree

9 files changed

+182
-162
lines changed

9 files changed

+182
-162
lines changed

masm-tasm/.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"dbaeumer.vscode-eslint",
66
"amodio.tsl-problem-matcher"
77
]
8-
}
8+
}

masm-tasm/.vscode/launch.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,34 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Run Extension",
9+
"name": "Run Web Extension ",
1010
"type": "extensionHost",
11+
"debugWebWorkerHost": true,
1112
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
1313
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}"
14+
"--extensionDevelopmentPath=${workspaceFolder}",
15+
"--extensionDevelopmentKind=web",
16+
"${workspaceFolder}/samples"
1517
],
1618
"outFiles": [
17-
"${workspaceFolder}/dist/**/*.js"
19+
"${workspaceFolder}/dist/web/**/*.js"
1820
],
19-
"preLaunchTask": "npm: watch"
21+
"preLaunchTask": "${defaultBuildTask}"
2022
},
2123
{
2224
"name": "Extension Tests",
2325
"type": "extensionHost",
26+
"debugWebWorkerHost": true,
2427
"request": "launch",
25-
"runtimeExecutable": "${execPath}",
2628
"args": [
2729
"--extensionDevelopmentPath=${workspaceFolder}",
28-
"--extensionTestsPath=${workspaceFolder}/dist/test/suite/index",
29-
"${workspaceFolder}/samples"
30+
"--extensionDevelopmentKind=web",
31+
"--extensionTestsPath=${workspaceFolder}/dist/web/test/suite/index"
3032
],
3133
"outFiles": [
32-
"${workspaceFolder}/dist/**/*.js"
34+
"${workspaceFolder}/dist/web/**/*.js"
3335
],
34-
"preLaunchTask": "npm: watch-tsc",
36+
"preLaunchTask": "${defaultBuildTask}"
3537
}
3638
]
37-
}
39+
}

masm-tasm/.vscode/settings.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8-
},
9-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10-
"typescript.tsc.autoDetect": "off",
11-
// "editor.formatOnSave": true,
12-
"markdownlint.config": {
13-
"MD033": false
14-
}
3+
"files.exclude": {
4+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"dist": true // set this to false to include "dist" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off"
1511
}

masm-tasm/.vscode/tasks.json

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,25 @@
55
"tasks": [
66
{
77
"type": "npm",
8-
"script": "watch",
9-
"problemMatcher": "$ts-webpack-watch",
10-
"isBackground": true,
11-
"presentation": {
12-
"reveal": "never"
8+
"script": "compile-web",
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
1312
},
14-
"label": "npm: watch"
15-
},
16-
{
17-
"type": "npm",
18-
"script": "compile",
19-
"label": "npm: compile"
13+
"problemMatcher": [
14+
"$ts-webpack",
15+
"$tslint-webpack"
16+
]
2017
},
2118
{
2219
"type": "npm",
23-
"script": "watch-tsc",
24-
"problemMatcher": "$tsc-watch",
20+
"script": "watch-web",
21+
"group": "build",
2522
"isBackground": true,
26-
"presentation": {
27-
"reveal": "never"
28-
},
29-
"label": "npm: watch-tsc"
30-
},
31-
{
32-
"type": "npm",
33-
"script": "lint",
3423
"problemMatcher": [
35-
"$eslint-stylish"
36-
],
37-
"label": "npm: lint",
38-
"detail": "eslint src --ext ts"
24+
"$ts-webpack-watch",
25+
"$tslint-webpack-watch"
26+
]
3927
}
4028
]
41-
}
29+
}

masm-tasm/package.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -445,18 +445,14 @@
445445
]
446446
},
447447
"scripts": {
448-
"clean": "rimraf dist/ web/dist",
449-
"postinstall": "node dev/downloadBundle.js",
450-
"watch-tsc": "tsc -watch -p ./",
451-
"watch": "webpack --mode development --watch",
452-
"compile": "webpack --mode production",
453-
"compile-dev": "tsc -p ./ && webpack --mode development",
454-
"test": "node ./dist/test/runTest.js",
455-
"test-web": "vscode-test-web --extensionDevelopmentPath=. --extensionTestsPath=dist/web/test/suite/index.js --extensionPath=../vscode-dosbox --open-devtools ./samples",
456-
"run-in-browser": "vscode-test-web --extensionDevelopmentPath=. --extensionPath=../vscode-dosbox .",
457-
"lint": "eslint src --ext ts",
458-
"lint-fix": "eslint src --ext ts --fix",
459-
"vscode:prepublish": "pnpm clean && pnpm compile"
448+
"test": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --extensionTestsPath=dist/web/test/suite/index.js",
449+
"pretest": "pnpm run compile-web",
450+
"vscode:prepublish": "pnpm run package-web",
451+
"compile-web": "webpack",
452+
"watch-web": "webpack --watch",
453+
"package-web": "webpack --mode production --devtool hidden-source-map",
454+
"lint": "eslint src",
455+
"run-in-browser": "vscode-test-web --browserType=chromium --extensionDevelopmentPath=. ."
460456
},
461457
"vsce": {
462458
"dependencies": false,

masm-tasm/samples/macro.asm

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.MODEL SMALL
2+
.STACK 100h
3+
4+
.DATA
5+
message DB "The sum is: ", "$"
6+
sumValue DW 0
7+
8+
.CODE
9+
main PROC
10+
MOV AX, @DATA
11+
MOV DS, AX
12+
13+
; Example usage of the ADD_AND_STORE macro
14+
MOV AX, 5
15+
MOV BX, 10
16+
ADD_AND_STORE AX, BX, sumValue
17+
18+
; Print the message
19+
MOV AH, 09h
20+
MOV DX, OFFSET message
21+
INT 21h
22+
23+
; Print the sum (converted to ASCII)
24+
MOV AX, sumValue
25+
CALL PrintDecimal
26+
27+
; Exit program
28+
MOV AH, 4Ch
29+
INT 21h
30+
main ENDP
31+
32+
; Macro Definition: ADD_AND_STORE
33+
ADD_AND_STORE MACRO reg1, reg2, dest
34+
MOV AX, reg1
35+
ADD AX, reg2
36+
MOV dest, AX
37+
ENDM
38+
39+
; Procedure to print a decimal value in AX
40+
PrintDecimal PROC
41+
PUSH BX
42+
PUSH CX
43+
PUSH DX
44+
PUSH SI
45+
46+
MOV BX, 10 ; Divisor
47+
MOV CX, 0 ; Digit counter
48+
MOV SI, 0 ; Buffer index
49+
50+
PrintLoop:
51+
MOV DX, 0 ; Clear remainder
52+
DIV BX ; AX = AX / BX, DX = remainder
53+
PUSH DX ; Store digit on stack
54+
INC CX ; Increment digit counter
55+
CMP AX, 0 ; Check if quotient is zero
56+
JNE PrintLoop
57+
58+
PrintDigits:
59+
POP DX ; Retrieve digit from stack
60+
ADD DL, '0' ; Convert to ASCII
61+
MOV [SI + Buffer], DL ; Store digit in buffer
62+
INC SI
63+
LOOP PrintDigits
64+
65+
MOV AH, 09h ; Print string function
66+
MOV DX, OFFSET Buffer
67+
INT 21h
68+
69+
POP SI
70+
POP DX
71+
POP CX
72+
POP BX
73+
RET
74+
PrintDecimal ENDP
75+
76+
.DATA
77+
Buffer DB 10 DUP('$') ; Buffer to store decimal digits
78+
79+
END main

masm-tasm/src/language/Hover.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { MarkdownString, Uri } from "vscode";
55
import { Cppdoc } from './hoverFromCppdoc';
66
import { FELIX } from './hoverFelix';
77
import { HoverFromMarkdown } from './hoverFromMarkdown';
8+
import * as ast from "./ast";
89

910
export enum keywordType {
1011
other = 0,
@@ -47,6 +48,9 @@ export class AsmHoverProvider implements vscode.HoverProvider {
4748
const docinfo = DocInfo.getDocInfo(document); //scan the document
4849
const line = docinfo.lines[position.line];
4950

51+
const {tokens, errors}=ast.tokenize(document.getText());
52+
const b=ast.parse(tokens);
53+
5054
if (range) {
5155
const wordGet = document.getText(range);
5256
const wordLowCase = wordGet.toLowerCase();

0 commit comments

Comments
 (0)