<--  back   Last regenerated: 2022-04-20 17:31:36 kio

zasm - Z80 Assembler – Version 4.4

Targets

#target TZX

Typical layout of a game tape

The assembler source file will probably contain several Assembler directives: #code
Including C Source Files: #code
#code segments. Normally each Assembler directives: #code
Including C Source Files: #code
#code segment defines one block on the tape.

• A normal block consists of a pilot tone (lead-in), two sync pulses, a #code: Flag Byte
#code: Flag Byte
flag byte, the raw data bytes and a final checksum byte.
• The flag argument defines the type of the block and is Pseudo instructions: defl, set and '='
Labels: SET
set in the Assembler directives: #code
Including C Source Files: #code
#code directive.
• Then the raw data follows which is the assembled data of this Assembler directives: #code
Including C Source Files: #code
#code segment.
• Finally a checksum is appended which is calculated by the assembler.

A tape file is a simple sequence of any number of these blocks.

Any kind of data was saved by the ZX Spectrum rom routine in two blocks: a header block, containing information about the following data, and a data block, containing data as described by the preceding header.

A complete game for the ZX Spectrum is typically saved in two parts: a Basic loader, which consists of a header and a data block and the machine code part, which consists of a header and data block too. The Basic part is typically saved with an auto start address which loads the following parts and starts the game.

The flag argument defines the type of block. This is typically $00 for a header block and $FF for the following data block.

zasm allows you to spread a tape block across multiple Assembler directives: #code
Including C Source Files: #code
#code segments. This is useful Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if you want to include C source files. Each Assembler directives: #code
Including C Source Files: #code
#code segment with a #code: Flag Byte
#code: Flag Byte
flag byte starts a new tape block. All following Assembler directives: #code
Including C Source Files: #code
#code segments with no #code: Flag Byte
#code: Flag Byte
flag byte are joined with this tape block. A segment address defined for a following block does not create a 'gap' on the tape. The segment will be loaded where it is loaded and the program is assumed to move it to the defined location befor it is used. Actually this is true for the first block too: The tape loader defines where the block will be loaded, not the segment address stated in the Assembler directives: #code
Including C Source Files: #code
#code directive. This can be used Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if you want to move the entire program to a lower location in ram when it starts up.

For an #insert: Examples:
#assert: Example:
incbin: Examples:
#assert: Example:
example of the basic layout of a ZX Spectrum tape see Assembler directives: #target
Including C Source Files: #target
#target TAP.

Valid HTML   Valid CSS