mborik / z80-macroasm-vscode Goto Github PK
View Code? Open in Web Editor NEWSupport for Z80 macro-assemblers in Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=mborik.z80-macroasm
License: MIT License
Support for Z80 macro-assemblers in Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=mborik.z80-macroasm
License: MIT License
I am the guy who writes many instruction in one line, separated by colon, so, i need to have splitInstructionsByColon
set to false
.
But eventually, when it's set to false, you just can't write space symbol after colon (because it's trimmed), so it's impossible to type more than one instruction in a line:
Reported by @alexanderk23 and @kolnogorov
If label was typed without colon but assigned to empty line (which is quite a common case), undefined
is inserted in the line after formatter was applied.
Type:
ld a,0xC0+2
Then type Space.
Result: +2 gets deleted.
ld a,0xC0
Add enum-type setting "z80-macroasm.format.hexaNumberStyle"
with these options:
#1fff
| #B45D
$1fff
| $B45D
1fffh
| 0B45Dh
1fffH
| 0B45DH
0x1fff
| 0xB45D
and "z80-macroasm.format.hexaNumberCase"
setting of semi-boolean type [ "no-change", true, false ]
. True will be uppercased, false lowercased.
Formatter implementation will be enhanced to detect and parse hexadecimal numbers in source-code and reformat it into user's preference given by settings defined above.
I have a piece of code like this:
DEFM: "Don't break : please"
The formatter will replace by invalid code like this:
DEFM "Don't break
please"
I have tried every permutation possible (or so it seems) to get this package to recognise the assembler file extensions I'm using - .Z80. For some reason, it refuses to code-highlight or otherwise work with my Z80 assembly files with the .Z80 extension. I've saved the exact same file as a .ASM file and it works fine with that. I've edited the settings and added .Z80 into the 'Files: include' array (**/*.{z80,asm,inc,s}) and have edited the JSON directly, but to no avail.
Any suggestions?
Hello.
VSCode has built-in support of snippets.
But the way they are handled by your great extension is not perfect.
Let me explain.
At this gif you can see, how snippets works in SublimeText - they are perfectly formatted and ready to use right after typing it.
Now, let's add same snippet into VSC:
As you can see, snippet is not properly formatted (pay attention to the label) and demands some handwork to get it to the usable state.
And note, please - I've used a very simple example of snippet - look at this one:
In VSCode, we'll need much more formatting work in this case.
So, question is simple: is it possible to solve this problem and use snippets with more efficiency?
Hi there - thanks for this plugin!
I am setting up my environment and I like to locate my .asm files in a subfolder of the main project solution and although the $errmatcher-sjasmplus problem matcher is correctly detecting the error in the assembly output, sjasmplus does not include the relative path when displaying the error:
> Executing task: D:\next\DMTestBong\project\bin\sjasmplus d:\next\DMTestBong\project\src\Project.asm --zxnext=cspect --msg=all <
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Project.asm(17): error: Unrecognized instruction: fred a, bill
Pass 3 complete
Errors: 1, warnings: 0, compiled: 57 lines, work time: 0.031 seconds
The terminal process terminated with exit code: 1
With the $errmatcher-sjasmplus defined as:
{
"name": "errmatcher-sjasmplus",
"owner": "z80-macroasm",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^(.*)\\(([0-9]+)\\): (error|warning):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
},
clicking the error in the Problems list results in an error as the file is assumed to be relative to the workspace folder.
However, if I amend my build task to include the --fullpath
switch:
> Executing task: D:\next\DMTestBong\project\bin\sjasmplus d:\next\DMTestBong\project\src\Project.asm --zxnext=cspect --msg=all --fullpath <
SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
d:\next\DMTestBong\project\src\Project.asm(17): error: Unrecognized instruction: fred a, bill
Pass 3 complete
Errors: 1, warnings: 0, compiled: 57 lines, work time: 0.015 seconds
The terminal process terminated with exit code: 1
Press any key to close the terminal.
This time, clicking the error in the Problems list results in an error as the file is still assumed to be relative to the workspace folder.
However, if I edit the extension package.json to use "autodetect":
{
"name": "errmatcher-sjasmplus",
"owner": "z80-macroasm",
"fileLocation": ["autodetect", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^(.*)\\(([0-9]+)\\): (error|warning):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
},
The problem path works whether the .asm file is in the workspace folder or nested lower.
Let's use this example:
global
ld hl, global
ld de, ; Cursor is before the comment
.local
If I type .l<tab>
I expect to obtain .local
.
Instead I obtain .global.local
that is totally invalid.
global.local
would be valid, but it is preferable to not have the global
part as we are already in its scope.
Hello!
In my tniASM 0.45 projects (e.g.: the include-heavy msx-msxlib or the much simpler msx-pyramidwarpex) no definitions are available:
However, they appear in the outline view:
And also appear when I "Go to Symbol in Workspace...":
Note 1: In other projects using different assemblers (e.g.: this one that uses Sjasm 0.39) definitions are correctly found and available.
Note 2: I don't know if it is related to this issue or if it is just a red herring, but assembler directives (IFDEF / IFEXIST / ENDIF) are recognized as symbols:
Thanks!
Hello and thanks for the great plugin!
I am having issues with saving files when I use sjasmplus module
construct, the module name is erased:
Before saving:
MODULE name
;; code
ENDMODULE
After saving:
MODULE
;; formatted code
ENDMODULE
Using version 0.7.1, vscode 1.55.2
It would be nice if it was possible to open (in a new tab) included files by using a key shortcut when the cursor is on an include
line directive (or equivalent) or by CTRL-clicking on the filename.
Hi,
I feel this plug-in almost perfect but for the asm auto-completion, IMHO very intrusive. The asm language is "short" to write, the completion boxes appearing so frequently for short writes can be distracting, and sometimes you have to press even more keys, i.e. when writing "ret", have to press enter 2 times for going to the next line.
Then I see very useful the auto-completion of labels, but not so much for the asm code itself. If I could disable it I'd do.
Thanks for the plug-in to all this.
This can be achieved by adding this to language.configuration.json
:
"folding": {
"markers": {
"start": "^\\s*;\\s*#?region\\b",
"end": "^\\s*;\\s*#?endregion\\b"
}
}
The cycle/byte counting feature reports incorrect results if any of the following features are present in the selected code:
As the title says. Some versions of Code, distributed on Linux in particular, use Open VSX Registry instead of the Microsoft Markeplace.
I have some old Z80 sources that I wrote for the M80 assembler.
As M80 accepts $-signs in labels I used those, but those are not correctly identified here. My guess would be that this line
"match": "\\b([a-zA-Z][\\w\\.]+)\\b",
should be changed to
"match": "\\b([a-zA-Z][\\w\\.$]+)\\b",
(see
)but I am not experienced with writing extensions so would first see if it was an easy fix for a maintainer.
Do you check the editor settings (.vscode)?
Seems like the asm editor is inserting tabs instead of spaces as my editor settings say...
Other than that, excellent extension!
TASM seems like quite a popular assembler, and the tutorial that I'm following uses it. It isn't listed on the list of compatible assemblers, though - would it be hard to add?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.