It is a convenience directive for defining least significant byte first two byte words, as the Z80 uses them. Multiple expressions, separated by commas, may be. ZASM is a compiler/assembler and monitor (including disassembler and debugger) for the Z80 CPU. It runs under Linux (probably also. Uses. The easiest way to put data directly into your program. Note that since the z80 processor is little-endian, loading into a bit register from.

Author: Zulur Shagul
Country: Belize
Language: English (Spanish)
Genre: Spiritual
Published (Last): 21 August 2008
Pages: 448
PDF File Size: 10.82 Mb
ePub File Size: 17.69 Mb
ISBN: 156-2-91107-730-6
Downloads: 32727
Price: Free* [*Free Regsitration Required]
Uploader: Kagar

compile dimenssion &copy _public_domain_ ()

People have requested to be able to overwrite the generated output. With these directives it assembleuf possible to define new commands, which will output defined code. If val qssembleur omitted, it defaults to 0.

It takes one or two arguments, num and val. Strings of bytes should be between double quotes. The argument is given in the same way as for include. This is mostly useful in combination with incbin. It is a convenience directive for defining least significant byte first two byte words, as the Z80 uses them.

Everything after this directive is ignored. It reserves num bytes of space and initializes them to val. Code which is not assembled is checked for a correct command.


Assembler directives

At the start of each page, the code can set the starting address to the mapping address. It allows any binary data to aesembleur included verbatim into the output. At the end of the program, it is allowed to use the “end” directive.

This sets the assembler’s idea of the current address. Almost any name is possible without escape characters, because of the quote rules. After this definition, it is possible to use the macro, like this: Multiple expressions, separated by commas, may be specified.

Org only changes the assembler’s idea of “where” it is. Otherwise it is not touched, which means that if you use these directives, a successfull assembler execution does not imply that all the code is correct. All definitions should be separated by commas. It allows definition of one or more literal bytes, as well as strings of bytes. This is what seek is for.

The previously defined pages are not overwritten. As in C but without thethis includes an other source file.

The first non-whitespace character after the include directive is considered the starting quote. Parts of the code can be omitted using these conditional statements.

Note that no code is generated by this directive, so if padding bytes are required, they must be inserted using defs. There is no need to do this. It takes one argument, which must evaluate to a value in the first pass it may not use labels which are defined later.


Incbin stands for “include binary”.

Assemmbleur allows the included binary to be “patched”. Using this directive more than once can be useful to create code which is to be executed at the same address, for example when the memory is mapped. If the argument of seek is greater than the current output size, the file is extended with zeros.

The official ZASM homepage

At the start, the current address is set to 0. It will seek in the output file and start overwriting previous output. The filename is then read, until the ending quote, which is the same as the starting assembleyr.

Normally, the first directive in a program is org, to set the starting address. This can be used to put some comments at the end. In the following example, the adsembleur contains 4 bytes: