Added ability to define multiple functions (without parameters) and
[zilutils.git] / zilasm / README.md
1 zilasm is an assembler that targets the Z-Machine. It is the default 
2 assembler used by zilc.
3
4 General syntax
5 ==============
6
7 Files processed by zilasm consist of instructions and directives, one 
8 per line.
9
10 Comments begin with ; and continue until end of line. Comments are 
11 ignored by the assembler.
12
13 Instructions
14 ------------
15
16 Instruction Number Meaning 
17 ----------- ------ ----------------------------------------------------
18 PRINTI      178    Prints a string.
19 QUIT        186    Terminates program execution.
20
21 Directives
22 ----------
23
24 zilasm uses directives which are instructions to the assembler itself. 
25 To distinguish them from instructions, directives begin with a period.
26
27 Directive  Meaning
28 --------- -------------------------------------------------------------
29 .END      Signifies the end of the program and terminates assembly. 
30           End-of-file (EOF) is also treated as the end of the program.
31
32 .FUNCT    Defines a function, which is a group of instructions. A 
33           function name, separated from the directive by space or tab, 
34           is also required. The function name may be optionally 
35           followed by a comma and include comma-separated argument 
36           list. A blank line, the .END directive or end-of-file (EOF) 
37           all indicate the end of the function.
38
39 Licensing
40 =========
41
42 This file is part of ZilUtils/ZilAsm
43
44 You can redistribute and/or modify this file under the terms of the 
45 GNU Affero General Public License as published by the Free Software 
46 Foundation, either version 3 of the license, or (at your option) any 
47 later version.
48
49 This file is distributed in the hope that it will be useful, but 
50 WITHOUT ANY WARRANTY; without even the implied warranty of 
51 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
52 Affero General Public License for more details.
53
54 You should have received a copy of the GNU Affero General Public 
55 License along with this file. If not, see 
56 <http://www.gnu.org/licenses/>
57
58 \$-- SPDX-License-Identifier: AGPL-3.0-or-later