Click here for English version!
Om voor de z80 te kunnen programmeren heeft u een assembler of compiler nodig. Ik vind het persoonlijk nog steeds leuk om in Z80 assembler te schrijven maar ik kon geen tools meer vinden voor Windows 10. Er was nog wel wat te downloaden maar het meeste werkte op DOS niveau. Na wat rond zoeken besloot ik dat tijd was voor een nieuw hobby project, het bouwen van een complete geïntegreerde Z80 ontwikkel omgeving. Ik vond een vrij goede assembler en goede portable C code van een emulator en de rest had ik nog ergens in mijn code bibliotheek. Het resultaat is Z80-workbench geworden, een portable x64 Windows programma dat een editor, assembler, disassembler, emulator, single step debugger, intel hex lees/schrijf functie een terminal window, een MPF-1 compatible zeven segment display met 8 leds en toetsenbord ondersteuning heeft.
Download het zip bestand en pak het uit op de plaats waar u het wilt installeren op uw harde schijf. Maak dan een snelkoppeling naar het programma naar het bureaublad en het programma is gereed voor gebruik. Het is een zogenaamd portable programma waardoor het geen gebruik maakt van externe bronnen of libraries en geen gebruik maakt van de registry. Na het verwijderen van de directory van dit programma is het ook helemaal van uw systeem verdwenen.
Om te oefenen staat er een example4.asm bestand in de example directory, dit kunt u laden waarna het in het edit venster in het midden zal staan. Nu kunt u dit door middel van de assemble knop omzetten in machinecode, dit zal links in het scherm verschijnen en in het virtuele geheugen van de emulator gezet gaan worden. De laatste (of eerste) .org zal ook inde program counter gezet worden en door een simpele druk op de run knop kunt u het programa uitvoeren en volgen op het scherm. Dit zal niet erg snel gaan omdat telkens bij elke instructie een scherm updatete zal gebeuren. Wanneer u het programma sneller wilt laten uitvoeren kunt u door middel van de update checkbox de update van het register blok uitschakelen. U kunt nu het programma aanpassen, opnieuw assembleren en weer uitvoeren.
Het basic2 voorbeeld is afkomstig van de site van Grant Searle, ik heb hier alleen een aangepaste BIOS achteraan gepplakt en .org 0000h om het startadres in te stellen.
Door middel van de step knop kunt u het programma instructie voor instructie uitvoeren en de uitvoer en de registers controleren. Ook kunt u het break adres invullen, de emulator zal dan bij een run commando stoppen op dit adres en de registers van dat moment tonen. Wanneer in het break veld 0000 staat zal het genegeerd worden.
U kunt de gewijzigde code weer als asm bestand opslaan maar ook als hex bestand wegschrijven zodat u de binaire code in een schakeling of ep(rom) kunt laden voor een echte Z80 schakeling. U kunt ook een Intel-Hex bestand inlezen, deze zal dan in het interne emulator geheugen geladen worden. Dit kunt u dan ook laten uitvoeren wanneer u het correcte startadres in de program counter zet. U kunt dit interne emulator geheugen ook laten disassembleren waarna er weer code in het edit scherm in het midden verschijnt. Dit kunt u dan aanpassen en door middel van asembleren weer terug schijven in het emulator geheugen.
De emulator kent standaard een aantal I/O poorten voor invoer van het toetsenbord en uitvoer naar het terminal scherm of de zeven segment displays / leds. In example4 staat een voorbeeld van beiden.
Credits: Dank aan Jorge Giner Cordero voor het mogen gebruiken en meeleveren van zijn Z80 assembler en Lin Ke-Fong voor het mogen gebruiken van zijn Z80 emulator code.
To be able to program for the z80 you need an assembler or compiler. I personally still like to write in Z80 assembler but I could no longer find tools for Windows 10. There were still some programs to download but most of them worked at DOS level. After some searching I decided that it was time for a new hobby project, building a complete integrated Z80 development environment. I found a pretty good assembler and good portable C code from an emulator and the rest I had somewhere in my code library. The result is Z80 workbench, a portable x64 Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex read / write function a terminal window, an MPF-1 compatible seven segment display with 8 LEDs and keyboard support.
Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.
To practice there is an example4.asm file in the example directory, which you can load after which it will be in the shown in the middle edit window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. The last (or first) .org statement will also be put in the program counter and by simply pressing the run button you can execute the program and follow it on the screen. This will not be very fast because every instruction will perform a screen update of all registers. If you want the program to run faster, you can disable the update of the registry block by means of the update checkbox. You can now modify the program, reassemble it and run it again.
The basic2 is an example of the basic assembler file from Grant Searle, I only added a modified BIOS file at the end and an .org 0000h at the end to set the start adresss.
By means of the step button you can execute the program instruction by instruction and check the output and the registers. You can also enter the break address, the emulator will then stop at a run command at this address and display the registers of that moment. When 0000 is entered in the break field it will be ignored.
You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real Z80 circuit. You can also read an Intel-Hex file, which will then be loaded into the internal emulator memory. You can also run tis code when you put the correct start address in the program counter. You can also disassemble this internal emulator memory code after which the source code will appears in the edit screen in the middle. This can then be changed and written back into the emulator memory by means of assemble button.
The emulator has a standard number of I/O ports for input from the keyboard and output to the terminal screen or the seven segment displays / LEDs. In example4 there is an example of both.
Credits: Credits go to Jorge Giner Cordero for letting me use and distribute his Z80 assembler, and Lin Ke-Fong for letting me use his portable C emulator code.
This is version 1.02 with improved assembler. This is a zip file containing a portable x64 Windows exe program, one example directory and an assembler directory.
Download z80_workbench102.zip (2020)
Download z80_workbench101.zip (2018)