Assembler
The Astrum assembler is a two pass assembler which means it goes through the source code twice. On the first pass it syntax checks the source code and determines the code layout and in particular the value of each label. The second pass generates the machine code and data. The resulting machine code and data are written to the filestore. If your source file is game.asm then by default the written file will be game.bin. You can change this with the OUTPUT assembler command. At present the output file is the output from the assembler, there is no header and can be loaded with LOAD "game.bin" CODE $e000 type statements.
The assembler can be in either upper or lower case but labels and symbols are case dependent. So FLAGS and flags are different symbols. In general you should avoid using labels or symbols that are the same as Z80 registers in either letter case. On thing to be aware of is using a bracket at the start of a constant expression. For example:
ld bc,(END_SYM-START_SYM)/3The start bracket makes Astrum think we are loading BC from memory when really we are loading a constant. This will produce a syntax error because the /3 looks extraneous. To get around this example add a leading +:
ld bc,+(END_SYM-START_SYM)/3This Next version of the assembler has been upgraded to include:
-
Undocumented Z80 instructions -
Astrum supports most if not all undocumented instructions. In particular it
supports the use of high and low bytes of the index registers:
LD IXH,12 LD A,IXL
- Z80N / Spectrum Next instructions - Astrum supports the Z80N instructions used by the Spectrum Next. It also allows you to use the BREAK instruction used by CSpect.
- Simple Macros
- Enlarged symbol table support - The original Astrum had a 10000-byte symbol table and it just about big enough to cope with producing ten kilobytes of machine code. The symbol table in this version is effectively as large as you will need. It can cover multiple memory banks and I doubt you will run out of space.
- Conditional assembly
- Include files
- Listings
- Directives