Z80ASM is cross platform assembler for Z80 processor, based on ideas of The Netwide Assembler (NASM) for Intel x86 platform,
therefore almost all features of this excellent assembler working in Z80ASM
(of course, there are some differences between x86 and Speccy assemblers).
For more information about preprocessor syntax, please, read
NASM manual.
If you want to download latest version of Z80ASM, click here.
Phase command brings some restrictions to format of object files, therefore no 'phase' analogue in Z80ASM. You may use this method
; main.asm
org 100h
ld hl,$ ; simple for test
incbin "relocfile.bin"
ld hl,$ ; simple for test
; end of main.asm
; relocfile.asm
org 200h
ld de,$ ; simple for test
; end of relocfile.asm
; make.bat
z80asm.exe relocfile.asm -o relocfile.bin
z80asm.exe main.asm
; end of make.bat
Also you may use makefile for same purpose:
main.bin: main.asm relocfile.bin z80asm.exe main.asm -o main.bin relocfile.bin: relocfile.asm z80asm.exe relocfile.asm -o relocfile.bin
In future versions Z80ASM will be support several output format's and this problem will be resolved.
Yes, but in comparison with other assemblers, Z80ASM use preprocessor for this issue
%if 0 Some comment text ... %endif
You may also use %define command in same way as below
; Please, remove comment for appropriate target or use command line options ; %define DEBUG ; %define PRE_RELEASE ; %define RELEASE %ifdef DEBUG Some debug source lines %elifdef PRE_RELEASE Some prerelease source lines %elifdef RELEASE Some release source lines %endif
Do it! The magic word is preprocessor. Define your commands and operands as you wish.
For example, please, consider this sample
%macro repeat 0
%push repeat
%$begin:
%endmacro
%macro until 1
jp %1,%$begin
%pop
%endmacro
and this...
repeat
ld a,(hl)
inc hl
or a
until nz
will be translated to
some_very_local_label:
ld a,(hl)
inc hl
or a
jp nz,some_very_local_label
Look at this example:
org 0x100
check_code_point:
times 257 db 0
%if $-check_code_point > 256
%error too large block!
%endif
For more information about Z80ASM, ask your question in FIDONET echo ZX.SPECTRUM or email to author.
For bugs reports and some wishes, please, use this email only for plain text
© Copyright 1997-2007, Ilya G. Aniskovets