Page 1 of 1

Emulator integrated with Pasmo assembler

Posted: Fri May 18, 2018 7:46 pm
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.

Re: Emulator integrated with Pasmo assembler

Posted: Fri May 18, 2018 8:17 pm
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?

Re: Emulator integrated with Pasmo assembler

Posted: Sat May 19, 2018 6:48 am
by Magnus
Thank you for the feedback @Ralf. 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).

Re: Emulator integrated with Pasmo assembler

Posted: Fri Jun 08, 2018 7:33 pm
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.

Re: Emulator integrated with Pasmo assembler

Posted: Sat Jun 09, 2018 10:05 pm
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.

Re: Emulator integrated with Pasmo assembler

Posted: Sun Jun 10, 2018 5:19 am
by Magnus
lister_of_smeg wrote:
Sat Jun 09, 2018 10:05 pm
Very nice!
Thank you :)

lister_of_smeg wrote:
Sat Jun 09, 2018 10: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!

Re: Emulator integrated with Pasmo assembler

Posted: Sat Jun 16, 2018 4:43 pm
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.