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

zasm - Z80 Assembler – Version 4.4

Targets

#target .O and .80

this format is not yet well tested. Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
If there are problems please send an email to Kio.

This creates a tape file for use with an ZX80 emulator. The '.o' and '.80' file formats are identical. The tape file will be loaded to the ram start at address $4000. There was no choice…

Code may be stored in one or more Assembler directives: #code
Including C Source Files: #code
#code segments. However, the first segment must be at least 0x28 bytes long and contain the system variables.

Assembler directives: #target
Including C Source Files: #target
#target 80 Assembler directives: #code
Including C Source Files: #code
#code <name>,<start>,<len> ...

See the ZX80 .o template file: template_o.asm

The tape data is always loaded to $4000, so this is the only choice for the <start> address in the Assembler directives: #code
Including C Source Files: #code
#code directive. The <size> may be any value up to a maximum of $C000, but most ZX80 had at most 16 kB of ram Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if extended with an external memory expansion, only 1 kB Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if none.

The ram starts with system variables from $4000 to $4028, which must be Pseudo instructions: defl, set and '='
Labels: SET
set to proper values. The variable E_LINE at $400A, which contains the Pseudo instructions: end, .end
8080 pseudo instructions: END
end of ram address, must be calculated properly and is checked by the assembler.

Note that zasm has a convenient assembler directive to translate from the ascii (or utf-8) characters in your source file to the non-ascii character Pseudo instructions: defl, set and '='
Labels: SET
set of the ZX80:

#charset ZX80

You can include c sources in your assembler file, but there are two pitfalls:

You can use the character Pseudo instructions: defl, set and '='
Labels: SET
set translation of zasm to translate strings in your c source as well. But unluckily character literals are not exported as character literals by the c compiler sdcc but as their ascii code and zasm has no chance to detect this. So character literals in your c source are not translated.

Second, character 0x00 is used in c sources as a string Pseudo instructions: end, .end
8080 pseudo instructions: END
end indicator, but it is also a valid character for the ZX80: the space. So you'll have to think of a way to work around this problem.

Valid HTML   Valid CSS