CPCWiki forum

General Category => Programming => Topic started by: Interrupt on 21:11, 03 January 23

Title: Modern assembly coding setup?
Post by: Interrupt on 21:11, 03 January 23
Back in the day I used Maxam with lots of disk swapping, limited debugging etc. Are there any recommendations for modern tools and workflow on Linux for writing Z80 assembler these days? Are there any emulators that are particularly good for debugging? I'm going to be finishing off (hopefully) a few unfinished demos from my youth. 
Title: Re: Modern assembly coding setup?
Post by: MoteroV4 on 22:07, 03 January 23
Quote from: Interrupt on 21:11, 03 January 23Back in the day I used Maxam with lots of disk swapping, limited debugging etc. Are there any recommendations for modern tools and workflow on Linux for writing Z80 assembler these days? Are there any emulators that are particularly good for debugging? I'm going to be finishing off (hopefully) a few unfinished demos from my youth.
I like CPCTelera under Linux. It is a framework that integrates the SDCC compiler (Z80 assembler or C), generates the DSK, SNA and CDT files when compiling and automatically opens the Winape or RVM emulator or the one you like best.

It also has a great API of optimized functions and tools that help a lot:

https://github.com/lronaldo/cpctelera
Title: Re: Modern assembly coding setup?
Post by: roudoudou on 22:34, 03 January 23
if you liked MAXAM syntax, Rasm can handle it (and generate CPR, SNA, DSK, BIN or whatever as well ) but i suggest to update the code with proper calculations (avoiding /256 to get lower byte of an address)

https://github.com/EdouardBERGE/rasm

Title: Re: Modern assembly coding setup?
Post by: norecess464 on 12:20, 04 January 23
I also suggest RASM from @roudoudou , it works pretty well, with a convenient syntax, and some nice helpers (options) to put compiled binary into a disc / cartridge file, ready to be debugged from an emulator.

For an emulator with debugging workflows, there is cpcec-gtk , which is a GTK front-end on top of CPCEC emulator from @cngsoft
Online documentation: https://bitbucket.org/norecess464/cpcec-gtk/src/master/
The .deb file is here: https://bitbucket.org/norecess464/cpcec-gtk/src/master/cpcec-gtk.deb
Once downloaded, use the following to install the emulator on your machine (this will work on any Debian-based Linux distro - Debian, Ubuntu, PopOS, etc.. - ; for other distros you will probably have to recompile the emulator by yourself)
sudo apt install libsdl2-2.0-0 libgtk-3-0
sudo dpkg -i cpcec-gtk.deb
sudo apt install -f

Please read carefully the doc of cpcec-gtk ; it explains how to generate symbols from RASM and use them into cpcec-gtk .

Otherwise, in the past I also used WinAPE (Windows emulator) running through Wine, that was a viable solution and it worked relatively well for me.
Title: Re: Modern assembly coding setup?
Post by: jimmyd on 15:05, 04 January 23
Quote from: norecess on 12:20, 04 January 23For an emulator with debugging workflows, there is cpcec-gtk , which is a GTK front-end on top of CPCEC emulator from @cngsoft
This looks like a great emulator, but I can't get it to emulate a CPC 464 even though I see that there is a cpc464.rom file installed in /usr/share/cpcec-gtk/roms ?
Title: Re: Modern assembly coding setup?
Post by: norecess464 on 15:40, 04 January 23
QuoteThis looks like a great emulator, but I can't get it to emulate a CPC 464 even though I see that there is a cpc464.rom file installed in /usr/share/cpcec-gtk/roms ?
Yes the Amstrad CPC 464 is not exposed into cpc-gtk . I suggest to use Amstrad CPC 6128 instead and pretend it's a 464 ;-)
(unless you are dependent of BASIC 1.0 etc).
Title: Re: Modern assembly coding setup?
Post by: abalore on 18:40, 04 January 23
Quote from: Interrupt on 21:11, 03 January 23Back in the day I used Maxam with lots of disk swapping, limited debugging etc. Are there any recommendations for modern tools and workflow on Linux for writing Z80 assembler these days? Are there any emulators that are particularly good for debugging? I'm going to be finishing off (hopefully) a few unfinished demos from my youth.
If you plan to do assembler games from scratch, I recommend WinAPE to compile and debug, and Visual Studio Code for code editing.
Title: Re: Modern assembly coding setup?
Post by: Interrupt on 22:43, 06 January 23
Thanks all. RASM + cpcec-gtk looks like a good combination for what I'm wanting to do. I've still got some old MAXAM assembler listings on disks I recently rediscovered so compatibility there seems like a nice bonus. 
Title: Re: Modern assembly coding setup?
Post by: norecess464 on 02:38, 07 January 23
@Interrupt One last thing. If you are doing advanced programming for the Amstrad CPC (cf. you mentioned demos in your first post), I suggest you to avoid relying entirely on a emulator to do your testing. Usually they are generally good, but you can still get bad surprises here and there. So, from times to times, I highly recommend you to test on the real machine, if you can. (And if you can't -> at least try testing your work on several emulators, not only one.)
Title: Re: Modern assembly coding setup?
Post by: Interrupt on 19:48, 07 January 23
Quote from: norecess on 02:38, 07 January 23@Interrupt One last thing. If you are doing advanced programming for the Amstrad CPC (cf. you mentioned demos in your first post), I suggest you to avoid relying entirely on a emulator to do your testing. Usually they are generally good, but you can still get bad surprises here and there. So, from times to times, I highly recommend you to test on the real machine, if you can. (And if you can't -> at least try testing your work on several emulators, not only one.)

Good point. I did test my 6128 was working still so that is at least available. Just need to sort out a way of transferring data between the PC and it - I see there have been some decent options developed over the years. 
Powered by SMFPacks Menu Editor Mod