Debug your MSX with VSCode

صفحة 4/8
1 | 2 | 3 | | 5 | 6 | 7 | 8

بواسطة albs_br

Champion (499)

صورة albs_br

19-07-2020, 17:07

Is anyone using it with tniAsm?

بواسطة S0urceror

Master (220)

صورة S0urceror

19-07-2020, 17:11

tniAsm does not support generating list-files. Maybe the original author can add it.

بواسطة Grauw

Ascended (10823)

صورة Grauw

19-07-2020, 19:43

S0urceror wrote:
Grauw wrote:

Can you give an example of what kind of output you would expect from Glass

The output has to look like this:

...

Important things to take into account:

  • filename should be listed in start/close lines starting with #
  • then the format: [line number] [address] [bytes] [label] [assembly]

I guess only the line number, address and labels are important. In the launch.json you can specify which input filter to use so as long as I can extract it with some RegEx we're good.

P.S. This listing is from some sample code that is part of the video I just put up on Youtube. There you'll find a lot more information.

I uploaded a new development build of Glass, where you can specify a list file to generate using the -L command line option. Let me know if that works for you!

بواسطة Briqunullus

Paladin (777)

صورة Briqunullus

19-07-2020, 19:19

Thanks for the video, it explained a lot. Turned out I take too much for granted with modern programming. For z80 assembler build and run debugger are two separate steps. I kind of assumed it would all happen magically at once. It makes sense, Dezog is running list files. If there is no list file, there is nothing to run. Hence the error message I got.

So added a makefile and that works fine. Compile a small example, bload it on OpenMSX, all fine. Last hurdle is that when I hit F5 in VSCode it says error connecting to OpenMSX. Nearly there...

بواسطة S0urceror

Master (220)

صورة S0urceror

20-07-2020, 00:35

Grauw wrote:

Let me know if that works for you!

Wow, thanks for updating Glass. Will check it and report back.

بواسطة Grauw

Ascended (10823)

صورة Grauw

20-07-2020, 18:41

I think it could use some improvement still so let me know your thoughts, I’ll share some tomorrow as well (now, bedtime).

Edit: I’m thinking of

line address byte byte byte byte <tab>code
12000 03FF 0A 1B 2C 3D 	Label: nop

Spaces to delimit the first values, and a tab before the assembly code to delimit it. Since nr of bytes is variable (0 to infinity), and you want to know exactly where the line begins to distinguish between labels without a : and instructions, the tab helps with parsing that more reliably.

Bytes less than 4 are padded since for instructions that is the maximum and we want to keep the indentation similar for easy reading. But it can still vary since line can exceed 99999 (unlikely), address can exceed FFFFH (more likely), and bytes can exceed 4 (likely, e.g. ds 10).

بواسطة Grauw

Ascended (10823)

صورة Grauw

20-07-2020, 18:41

Grauw wrote:

I’m thinking of

line address byte byte byte byte <tab>code
12000 03FF 0A 1B 2C 3D 	Label: nop

Spaces to delimit the first values, and a tab before the assembly code to delimit it. Since nr of bytes is variable (0 to infinity), and you want to know exactly where the line begins to distinguish between labels without a : and instructions, the tab helps with parsing that more reliably.

Bytes less than 4 are padded since for instructions that is the maximum and we want to keep the indentation similar for easy reading. But it can still vary since line can exceed 99999 (unlikely), address can exceed FFFFH (more likely), and bytes can exceed 4 (likely, e.g. ds 10).

I uploaded a build with this change. And, coincidentally, usually (but not always) the source code starts at column 25, preceded by a tab on column 24.

بواسطة S0urceror

Master (220)

صورة S0urceror

20-07-2020, 20:11

I just got it working with your previous build. Question Smile

But no worries I use a regexp to select the address, bytes and mnemonic and it’s relatively easy to update. This done via the filter property that allows assemblers with different output formats to work as well.

I’ll upload this release later tonight and check if your new version also works.

بواسطة Grauw

Ascended (10823)

صورة Grauw

20-07-2020, 21:04

Cool, I had seen your previous message before you edited it, so I thought I could make the output a bit more compact and robust, and secretly also a little more similar to Sjasm’s output although that certainly isn’t a design goal Smile.

بواسطة S0urceror

Master (220)

صورة S0urceror

20-07-2020, 22:19

Completed my tests and updated the RegEx filter. You can find the latest Glass compatible release here.

This page also contains an example launch.json that contains the right filter to make it Glass compatible. Remove the filter to interpret SjasmPlus list-files natively. If anyone has another assembler outputting a proper list file, write a regular expression, and you're good to go.

Also in this release is support for ASSERTions. Check the Dezog Sample to see how that works. Don't forget to switch ASSERTions on in the Debug Console or in the launch.json.

And last but not least, I have added the pcInSlot attribute that tells in which slot,subslot,page/bank the code is expected to run. This tells OpenMSX to break in a specific ROM bank or RAM segment instead of everytime it hits that address. I added this feature particularly for my MSXUSB project where I debug Nextor ROM drivers that sit in bank 7.

صفحة 4/8
1 | 2 | 3 | | 5 | 6 | 7 | 8