.\" $Id$
.TH Z80_AS 6 "$Revision$"
.ad
.SH NAME
z80_as \- assembler for Zilog z80
.SH SYNOPSIS
~em/lib.bin/z80/as [options] argument ...
.SH DESCRIPTION
This assembler is made with the general framework
described in \fIuni_ass\fP(6). It is an assembler generating relocatable
object code in \fIack.out\fP(5) format.
.SH SYNTAX
.IP registers
The z80 has six general-purpose 8-bit registers: b, c, d, e, h, l;
an 8-bit accumulator: a; an 8-bit flag register: f; an 8-bit interrupt
vector: i; an 8-bit memory refresh register: r; two 16-bit index registers:
ix, iy; a 16-bit stack pointer: sp; and a 16-bit program counter: pc.
The general-purpose registers can be paired to form three registers pairs of
16 bits each: bc, de, hl.
An alternate set of registers is provided that duplicates the accumulator,
the flag register, and the general-purpose registers. The "exx"-instruction
exchanges the contents of the two sets of general-purpose registers; the
contents of the accumulator and flag register can be exchanged with the contents
of their alternates by the "ex af, af2"-instruction.
.IP "addressing modes"
.nf
.ta 8n 16n 24n 32n 40n 48n
syntax		meaning

expr		dependent on the instruction, the
		value of \fIexpr\fP can be immediate
		data or the address of the operand.
		There is no special notation for
		immediate data.

(ireg + expr)
(ireg - expr)	the contents of ireg (which must be
		one of the index-registers) + or -
		the - one byte - value of \fIexpr\fP
		yield the address of the operand.

(expr)		the value of \fIexpr\fP is the address of
		the operand.

reg		the contents of \fIreg\fP - one of the above-
		mentioned registers - is the operand.

(reg)		the contents of \fIreg\fP - one of the 16-bit
		registers except pc - is the address of
		the operand.

nz, z, nc, c,
po, pe, p, m	the letters indicate a condition-code:
		nonzero, zero, carry, no carry,
		parity odd, parity even, sign positive,
		sign negative respectively. Used by conditional
		jump, call, and return instructions.

.fi
.IP instructions
The jr-instruction will automatically be replaced by a jp-instruction if the
target is too remote.
.SH "SEE ALSO"
uni_ass(6),
ack(1),
ack.out(5),
.br
Z80 Users Manual, Joseph J. Carr, Reston Publishing Company, 1980