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:
- Create a new ZX Spectrum 48 project (see details here).
The
CodeFiles
project of the folder contains aCode.z80asm
file:
; Code file
start:
.org #8000
- Extend to the code with a few lines:
; Code file
start:
.org #8000
ld a,2
out (#fe),a
jp #12a2
- 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):
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:
You can easily export the code with these steps:
- In Solution Explorer, right-click the
Code.z80asm
file, and invoke the Export Z80 program command:
- The IDE pops up the Export Z80 Program dialog:
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.
- 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:
You have many other options to export your code, I will explain them in another tutorial.