Emulator integrated with Pasmo assembler

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Emulator integrated with Pasmo assembler

Post by Magnus »

This is just a first version, but it would be interesting to hear what you think of my effort to integrate the Pasmo assembler into my emulator, and if you have any suggestions for improvements. The way it works is that you select an .asm file and let the emulator invoke the assembler, which saves the resulting code to a file, which the emulator then loads into RAM behind the scenes.

If you want to give it a try, the emulator can be downloaded from the link in my signature. The assembler is not included in the download, but it can be found here: http://pasmo.speccy.org/. Once you have installed the assembler, start the emulator and open the assembler window under the tools menu. There, you need to tell the emulator where you have installed Pasmo.exe (default is c:\tools\pasmo\). Then you can choose a source file, set a target memory location, assemble and load the machine code.
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
Ralf
Rick Dangerous
Posts: 2279
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Emulator integrated with Pasmo assembler

Post by Ralf »

I't seems promising but does it give any serious advantage?

When you do it standard way you:
- open .asm file in text editor
- press shortcut to compile it
- click on compiled file to open it in emulator

It may seem more work but if you have you project opened, compiling and opening your snapshot lasts maybe 2 seconds ;)

It would be great if you were able to import labels and comments from .asm file to debugger. Did you considered that?
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: Emulator integrated with Pasmo assembler

Post by Magnus »

Thank you for the feedback [mention]Ralf[/mention]. You have a good point about the possible advantages with this solution. Maybe this just reveals the fact that I'm not an assembly programmer myself :oops: and that I haven't investigated how to set up an efficient workflow the way you describe it.

That said, I hope to add functions to improve the workflow, and will definitely look into your suggestion about importing labels to the debugger (importing comments would be great, but more difficult).
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: Emulator integrated with Pasmo assembler

Post by Magnus »

I made a little experiment and let the emulator load the symbol table which Pasmo generates into the debugger, like this:
Image

The symbols are stored in an array in parallel with the memory array. It would be nice to pre-load the labels from a ROM disassembly as well.
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
User avatar
lister_of_smeg
Microbot
Posts: 145
Joined: Thu Nov 16, 2017 1:44 pm

Re: Emulator integrated with Pasmo assembler

Post by lister_of_smeg »

Very nice!

Even better would be if you could set execution breakpoints in the emulator using comments in the asm source.

For example, something like:-

Code: Select all

	...
loop:	dec	e		;!br
	call	nz, routine
	jr	loop
	...
...and the emulator would set a breakpoint at the relevant address.
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: Emulator integrated with Pasmo assembler

Post by Magnus »

lister_of_smeg wrote: Sat Jun 09, 2018 11:05 pm Very nice!
Thank you :)

lister_of_smeg wrote: Sat Jun 09, 2018 11:05 pm Even better would be if you could set execution breakpoints in the emulator using comments in the asm source.
I think it would be difficult to set breakpoints using comments in the source as long as I let Pasmo handle the assembly; the emulator never sees the source, and there is no way that I know to connect a comment in the source to the binary code. What I could do is to treat labels with a certain character or string as breakpoints. I'll look into that. Thank you for the suggestion!
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
Magnus
Dizzy
Posts: 61
Joined: Sat Jan 06, 2018 6:47 am
Location: Sweden

Re: Emulator integrated with Pasmo assembler

Post by Magnus »

Breakpoints are now created automatically from labels named 'BR1', 'BR2' or 'BR3' (there are only three breakpoints in the debugger). After loading a source file with breakpoint labels, the user has to activate them in the debug window - (I may add an activation button in the assembler window later).

Other improvements to the assembler functions are:
  • A "Run" button to run the assembled code.
  • Preloaded labels from Geoff Wearmouth's ROM disassembly for the 48K ROM (not really an assembler function actually). If and when I find labels for other ROM:s I'll add them as well.
My ZX Spectrum emulator project: https://softspectrum48.weebly.com.
Post Reply