The Integrated Development Environment (IDE) documented here lets you write Z80 assembly language and see it running within a few milliseconds on a TRS-80 emulator.
The code is on the left, the emulator is on the right, and the pull-down menu is on top. As you type into the editor, the code is assembled on the fly. The machine language bytes are shown on the left next to each line. With every re-assembly, the TRS-80 emulator on the right is wiped clean, brought to a known state, and your program is loaded and run.
Try this simple program:
.org 0x8000
ld hl,15360
ld a,191
ld (hl),a
stop:
jp stop
The stop label must be in the first column, the rest must not be in the first column, and the indent is typically 8 spaces. It loads at 0x8000 (the start of the top 32K of RAM) and puts a graphic character block at the top-left of the screen. You should see this block appears as soon as you've finished typing the program. Try changing the character (191) to different values and watch the emulator update.
In TRS-80 programs, screenshots such as splash screens and game mazes are often hard-coded into the assembly language code using a sequence of byte statements, like this:
.byte 0x87,0x8B,0x8C,0x8C,0x8C,0x8C,0x83,0x83
.byte 0x83,0x89,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C
These are tedious to write and edit. To simplify making these, the IDE provides a built-in paint program. Simply mark your bytes with these start and end comments:
; Screenshot
.byte 0x87,0x8B,0x8C,0x8C,0x8C,0x8C,0x83,0x83
.byte 0x83,0x89,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C
; End screenshot
A EDIT button will appear to the right of the Screenshot comment. Click it to launch the paint program, which will replace the emulator's screen on the right. Click and drag in the screen to paint. Above the screen are various standard paint tools, most of which should be self-explanatory. Hover over each tool to see a hint about what it does.
To save the painted screen back into the source code, click the check mark button. To cancel, click the circle-with-a-slash button to the right of it.
The coordinates shown below the screen can be useful when constructing screens. Hold the Shift key while dragging out a new line, rectangle, or ellipse to get 45-degree lines, squares, or circles. The copy button not only copies the screen (or selected area) for later pasting within the paint program, but also copies an image of the area to your system clipboard for pasting into other applications.
The program has infinite undo/redo, so don't be afraid to experiment!
The assembler attempts to handle the union of all past Z80 assembler syntaxes. For example, it handles both org and .org directives. For numeric literals in non-decimal bases, it handles C-style prefixes (0x3C00, 0b10001010), assembler-style prefixes ($3C00, %10001010), and assembler-style suffixes (3C00h, 10001010b).