How to setup a mixed C / Z80-assembler toolchain in Visual Studio Code
Asked Answered
L

1

6

I want to use Visual Studio Code for writing code for my homebrew Z80 Computer. I use z88dk and its tools to compile C, assemble the Z80 asm files etc. I will write parts in assembler and other parts in C. I also need to edit .m4 files. Would be nice if these file types would have syntax coloring.

I am totally new to vscode and I have seen some languages for the z80 but I have no idea how to continue from there - or if these will even work at all.

I don't want to have to write a language extension because that looks like just too much work - from what I understand. I am also not a typescript/javascript developer.

Is there a tutorial out there on how to set this up, or any other helpful resources?

Lsd answered 16/12, 2016 at 7:37 Comment(1)
A fun aside - check out Color Gameboy development when you get a chance. It was done on a Z80 (esque) platform.Rutherford
E
1

I'm looking this up as I type so it may not be sufficiently complete to warrant a tick but I hope it'll be useful.

Per Adding Language Colorization you can use TextMate-format colourisation rules so jumping through those rules with something like this 'Z80 Asm' rule set should get you syntax highlighting. It doesn't look like it's a lot of work given that somebody else has already written the highlighting rules.

Microsoft's documentation on Tasks also guides you through using tasks.json to incorporate into your workspace "a task runner like gulp or grunt or any command line tool like a compiler or linter". So you should be able to create a z88dk running task fairly easily.

Edger answered 19/12, 2016 at 18:28 Comment(1)
Thanks. I finaly found the tasks.json and pretty much got that working the way I wanted. I found the terms tasks and commands used very confusing. Also how they (sort of) supported multipl tasks. The syntax coloring is harder. It seems you do have to write a language extension for that. I've installed the Z80-asm extension and that seems to work ok, although the colors are not my choice - but its better than nothing.Lsd

© 2022 - 2024 — McMap. All rights reserved.