The syntax is standard z80, however the assembler is not a simple two-pass - the tools are more like gcc than tasm, eg. The assembler is a linking assembler with sections which means you define a memory map composed of sections with org. Code does not use org - instead code and data is assigned to sections defined in the memory map. You don't have to define a memory map as a default one will be provided by the tools.
You can use the tools in roughly three ways. One is by using the the complete dev environment which includes optional access to all the library code (integer math, floating point, strings, data compression, stdlib, stdio, etc.) in which case your program is composed of a crt and your code (asm or c). The crt is as little as a couple of dozen bytes that performs initialization, handles program exit, and so on and it will call "_main" to start your program. That means if your program is asm, it must start at label "_main". For the rc2014 in particular, there are several crts to choose from with the main difference being what io is automatically supported. One is the basic_dcio crt which will put drivers on stdin/stdout/stderr to do line editing and character io using basic's rst 8 code. You can then do io with line editing using the c library code from asm (the c library is written in asm and has asm entry points). Another ("none" I think) provides nothing so you have a blank slate. Library code is not foisted on you - it's only going to be attached if you use it.
A second way is to use a --no-crt compile. In this case you define your own memory map in a separate file and then add it as the first file in the compile line. The program will assemble with nothing except your code in it. Unless your memory map defines the sections the library needs, you will not be able to use the library code in your project.
The last way is to invoke z80asm directly to assemble things like you would a regular 2-pass assembler. However, the --no-crt compile is better IMO as it will make rc2014 defines available as well as supply zcc's front end which includes macros, list files, application maker, etc.
Yes there's more to it than a basic two-pass assembler but that's unavoidable for a non-trivial project :)
Simple example using the full dev environment with crt where the entry point is "_main"
SECTION code_user ;; which section should this be placed in?
PUBLIC _main ;; make this symbol visible outside this file with EXTERN (crt must see this symbol to start program)
_main:
ld hl,10
ret
zcc +rc2014 -vn -subtype=none -clib=sdcc_iy test.asm -o test -create-app
You will want to customize the crt by setting some pragmas that disable features you don't want. This will bring the crt down in size to a couple dozen bytes. Without the pragmas you will be getting default behaviour suitable for the c environment (a heap is made, eg).
https://www.z88dk.org/wiki/doku.php?id=libnew:target_embedded#crt_configurationA no-crt compile:
"zmap.asm"
;;; define a memory map here
;;; very simple one with one section and one org
SECTION CODE
org 0x9000
"test.asm"
SECTION CODE
PUBLIC start
start:
ld hl,10
ret
zcc +rc2014 -vn --no-crt -m -clib=sdcc_iy zmap.asm test.asm -o test
Because there is no crt, the necessary symbols for -create-app are unavailable so you must take the output binaries and call appmake directly to generate ihx, etc if you need that.The output will be one binary per section with org in the memory map. "appmake +glue" can be used to put those binaries together to form a single block with gaps filled with a filler byte.