Pristine Ack-5.5
[Ack-5.5.git] / man / z80_as.6
1 .\" $Id: z80_as.6,v 1.4 1994/06/24 14:02:31 ceriel Exp $
2 .TH Z80_AS 6 "$Revision: 1.4 $"
3 .ad
4 .SH NAME
5 z80_as \- assembler for Zilog z80
6 .SH SYNOPSIS
7 ~em/lib.bin/z80/as [options] argument ...
8 .SH DESCRIPTION
9 This assembler is made with the general framework
10 described in \fIuni_ass\fP(6). It is an assembler generating relocatable
11 object code in \fIack.out\fP(5) format.
12 .SH SYNTAX
13 .IP registers
14 The z80 has six general-purpose 8-bit registers: b, c, d, e, h, l;
15 an 8-bit accumulator: a; an 8-bit flag register: f; an 8-bit interrupt
16 vector: i; an 8-bit memory refresh register: r; two 16-bit index registers:
17 ix, iy; a 16-bit stack pointer: sp; and a 16-bit program counter: pc.
18 The general-purpose registers can be paired to form three registers pairs of
19 16 bits each: bc, de, hl.
20 An alternate set of registers is provided that duplicates the accumulator,
21 the flag register, and the general-purpose registers. The "exx"-instruction
22 exchanges the contents of the two sets of general-purpose registers; the
23 contents of the accumulator and flag register can be exchanged with the contents
24 of their alternates by the "ex af, af2"-instruction.
25 .IP "addressing modes"
26 .nf
27 .ta 8n 16n 24n 32n 40n 48n
28 syntax          meaning
29
30 expr            dependent on the instruction, the
31                 value of \fIexpr\fP can be immediate
32                 data or the address of the operand.
33                 There is no special notation for
34                 immediate data.
35
36 (ireg + expr)
37 (ireg - expr)   the contents of ireg (which must be
38                 one of the index-registers) + or -
39                 the - one byte - value of \fIexpr\fP
40                 yield the address of the operand.
41
42 (expr)          the value of \fIexpr\fP is the address of
43                 the operand.
44
45 reg             the contents of \fIreg\fP - one of the above-
46                 mentioned registers - is the operand.
47
48 (reg)           the contents of \fIreg\fP - one of the 16-bit
49                 registers except pc - is the address of
50                 the operand.
51
52 nz, z, nc, c,
53 po, pe, p, m    the letters indicate a condition-code:
54                 nonzero, zero, carry, no carry,
55                 parity odd, parity even, sign positive,
56                 sign negative respectively. Used by conditional
57                 jump, call, and return instructions.
58
59 .fi
60 .IP instructions
61 The jr-instruction will automatically be replaced by a jp-instruction if the
62 target is too remote.
63 .SH "SEE ALSO"
64 uni_ass(6),
65 ack(1),
66 ack.out(5),
67 .br
68 Z80 Users Manual, Joseph J. Carr, Reston Publishing Company, 1980