ack/man/6809_as.1

148 lines
4.7 KiB
Groff
Raw Normal View History

1984-07-12 15:16:23 +00:00
.\" $Header$
.TH 6809_AS 1
.ad
.SH NAME
6809_as \- assembler for 6809
.SH SYNOPSIS
/usr/em/lib/6809_as [options] argument ...
.SH DESCRIPTION
This assembler is made with the general framework
described in \fIuni_ass\fP(6).
.SH SYNTAX
.IP registers
The 6809 contains four 8-bit registers registers:
two accumulators (a and b),
a direct page register (dp),
and a condition code register (cc),
and five 16-bit registers:
two index registers (x and y),
a user an a hardware stack pointer (u resp. s),
and a program counter (pc).
The index registers and the stack pointers are indexable.
Accumulators a and b can be concatenated to form
the double accumulator d,
of which a is the high and b is the low byte.
An instruction that refers to accumulator a
has an "a" as last character.
In the same way a "b" means that the instruction
uses b as accumulator.
.IP "pseudo instructions"
The 6809 assembler recognizes one additional instruction
that is not translated into a machine instruction: setdp.
It expects an expression as argument.
This is used for efficient address encoding of some addressing
mode (see below).
.IP "addressing modes"
.nf
1986-01-20 20:39:09 +00:00
.ta 8n 16n 24n 32n 40n 48n
1984-07-12 15:16:23 +00:00
syntax meaning (name)
1986-01-20 20:39:09 +00:00
reg The operand of the instruction is in \fIreg\fP.
1984-07-12 15:16:23 +00:00
1986-01-20 20:39:09 +00:00
reglist \fIreglist\fP is a either list of registers, seperated
1984-07-12 15:16:23 +00:00
by ','s, or the word "all". It encodes in a register
save mask, where "all" means all registers, that can
be used by the push-pull instructions pshs, pshu,
puls, and pulu.
1986-01-20 20:39:09 +00:00
<expr The one-byte value of \fIexpr\fP is an address within
1984-07-12 15:16:23 +00:00
a 256-byte page. The particular page in use is
1986-01-20 20:39:09 +00:00
indicated by the contents of dp, so \fIexpr\fP is the
1984-07-12 15:16:23 +00:00
low byte of the effective address of the operand,
and dp the high byte. (direct)
1986-01-20 20:39:09 +00:00
>expr The two-byte value of \fIexpr\fP is the exact memory
1984-07-12 15:16:23 +00:00
address. Not that this mode always requires one
byte more than "<expr". (extended)
1986-01-20 20:39:09 +00:00
expr The value of \fIexpr\fP is an address.
1984-07-12 15:16:23 +00:00
Except for long branches, this value is examined
first to see if a short encoding is possible.
When the instruction is a short branch, the value
is checked to see if the address is not too remote,
because in that case this branch is automatically
replaced by a long branch. When the instruction is
not a branch, the high byte of the value is compared
with the value of the argument of the last setdp
pseudo. If they are equal, this mode is replaced by
"<expr", else by ">expr".
(relative for branch-instructions)
1986-01-20 20:39:09 +00:00
#expr The value of \fIexpr\fP is one- or two-byte immediate
1984-07-12 15:16:23 +00:00
data. (immediate)
1986-01-20 20:39:09 +00:00
(expr) The value of \fIexpr\fP is a pointer to the address
1984-07-12 15:16:23 +00:00
of the operand. (indirect)
1986-01-20 20:39:09 +00:00
expr, reg The value of \fIexpr\fP added to the contents of \fIreg\fP
1984-07-12 15:16:23 +00:00
(which must be a 16-bit register) yields the
effective address of the operand.
(constant-offset indexed)
1986-01-20 20:39:09 +00:00
, ireg The contents of \fIireg\fP (which must be indexable)
1984-07-12 15:16:23 +00:00
yields the effective address of the operand.
(constant-offset indexed)
1986-01-20 20:39:09 +00:00
(expr, reg) The value of \fIexpr\fP added to the contents of \fIreg\fP
1984-07-12 15:16:23 +00:00
(which must be a 16-bit register) yields a pointer
to the effective address of the operand.
(constant-offset indexed indirect)
1986-01-20 20:39:09 +00:00
(, ireg) The contents of \fIireg\fP (which must be indexable)
1984-07-12 15:16:23 +00:00
yields a pointer to the effective address of the
operand. (constant-offset indexed indirect)
1986-01-20 20:39:09 +00:00
ac, ireg The contents of \fIac\fP (which must be an accumulator)
added to the contents of \fIireg\fP (which must be
1984-07-12 15:16:23 +00:00
indexable) yields the effective address of the
operand. (accumulator indexed)
1986-01-20 20:39:09 +00:00
(ac, ireg) The contents of \fIac\fP (which must be an accumulator)
added to the contents of \fIireg\fP (which must be
1984-07-12 15:16:23 +00:00
indexable) yields a pointer to the effective address
of the operand. (accumulator indexed indirect)
,ireg+
1986-01-20 20:39:09 +00:00
,ireg++ The contents of \fIireg\fP (which must be indexable) is
1984-07-12 15:16:23 +00:00
used as effective address of the operand. After that
it is incremented by 1 (+) or 2 (++).
(auto-increment)
1986-01-20 20:39:09 +00:00
(,ireg++) The contents of \fIireg\fP (which must be indexable) is
1984-07-12 15:16:23 +00:00
used as a pointer to the effective address of the
operand. After that it is incremented by 2.
(auto-increment indirect)
,-ireg
1986-01-20 20:39:09 +00:00
,--ireg \fIireg\fP (which must be indexable) is decremented
1984-07-12 15:16:23 +00:00
by 1 (-) or 2 (--). After that, its contents is used
as effective address of the operand.
(auto-decrement)
1986-01-20 20:39:09 +00:00
(,--ireg) \fIireg\fP (which must be indexable) is decremented by 2.
1984-07-12 15:16:23 +00:00
After that, its contents is used as a pointer to the
effective address of the operand.
(auto-decrement indirect)
.fi
.SH "SEE ALSO"
uni_ass(6),
ack(1),
.br
MC6809 preliminary programming manual, Motorola Inc., First Edition, 1979
.SH EXAMPLE
An example of 6809 assembly code.
.nf
1986-01-20 20:39:09 +00:00
.ta 8n 16n 24n 32n 40n 48n
1984-07-12 15:16:23 +00:00
contby = 80
compgo: lda #contby
ldx #table - 2 !start of table
clrb
co1: addb #2
lsra
bcc co1
jmp (b, x) !accumulator offset indirect
.fi