SpectNet IDE

Visual Studio 2017/2019 integrated ZX Spectrum IDE for the Community

Tutorials » Export a Z80 Program

After you created your Z80 Assembler program, you can easily export it into a .TAP or .TZX file so that you could load it into a ZX Spectrum emulator, or into a real hardware, such as a ZX Spectrum Next, or ZX Spectrum (with the help of TZXDuino or CASDuino hardware).

To try how easy it is, create a simple Z80 program:

  1. Create a new ZX Spectrum 48 project (see details here). The CodeFiles project of the folder contains a Code.z80asm file:
; Code file
start:
    .org #8000
  1. Extend to the code with a few lines:
; Code file
start:
    .org #8000
    ld a,2
    out (#fe),a
    jp #12a2
  1. In Solution Explorer, right-click the Code.z80asm file, and invoke the Run Z80 program command (or use the Ctrl+M, Ctrl+R double shortcut keys):

Run Z80 code command

This command compiles the Z80 assembly code to binary machine code, starts (or restarts) the Spectrum virtual machine, injects the binary code, and runs it:

Z80 code runs

You can easily export the code with these steps:

  1. In Solution Explorer, right-click the Code.z80asm file, and invoke the Export Z80 program command:

Export Z80 code command

  1. The IDE pops up the Export Z80 Program dialog:

Export Z80 code command

You can change the attributes of the exported program. The default settings of the dialog will create a loader program that automatically loads and runs the code. Beside the default options, I set the Add the exported tape file to the project checkbox.

  1. Click Export.

Now, you can find the exported code file in the C:\Temp folder (Code.tzx), and also in your project, within the TapeFile folder:

Exported Z80 code in project

You have many other options to export your code, I will explain them in another tutorial.