6805_AS(1)

NAME
6805_as - assembler for Motorola 6805

SYNOPSIS
/usr/em/lib/6805_as [options] argument ...

DESCRIPTION
This assembler is made with the general framework described in uni_ass(6).

SYNTAX

registers
    The 6805 has an accumulator register A and an index register X. An instruction (from the read-modify-write group) that references the A-register has an "a" suffixed to the mnemonic. In a similar way the X-register, apart from indexing operations, is addressed with an "x" suffix, i.e. "lsra" and "negx".

addressing modes
    The assembler automatically selects the shortest opcode if appropriate and possible. Thus "sub 10" will use the direct addressing mode whereas "neg 0,x" will use indexed (no offset) mode. There are sick constructions where the assembler can't find out the shortest form in time. In those cases the longest form is used.
    Branches are handled in much the same way. If a branch is out of range it is replaced by a reversed condition branch, followed by a jump, automatically.

    syntax		meaning (name)
    #expr		a one byte value (immediate)
    <expr		1-byte zero page address. Allowed in
    		the register/memory and read-modify-
    		write instruction groups. (direct)
    >expr		2-byte address. Allowed in the register
    		memory group. (extended)
    expr		1-byte address if appropriate, 2-byte
    		in other cases. (auto-direct/extended)
    ,x		indexed with zero offset. (indexed)
    <expr,x		indexed with 8 bit offset. (indexed-1)
    >expr,x		indexed with 16 bit offset. (indexed-2)
    expr,x		indexed with the shortest possible off-
    		set. (auto indexed)
    bit,expr	bit number and direct address.
    		(bit set/clear)
    bit,expr,tag	bit number, direct address and branch
    		tag. Automatically changed to reversed
    		condition branch and jump if appropri-
    		ate. (bit test and branch)
    tag		branch tag. Converted to reversed con-
    		dition branch and jump if appropriate.
    		(branch)

PSEUDO INSTRUCTIONS

     .dram    use the zero page ram/io segment.
     .dprom    use the zero page (ep)rom segment.
     .cmos    assemble cmos version instructions.

SEE ALSO
uni_ass(6), ack(1),
M6805 HMOS, M146805 CMOS family, Motorola, Prentice-Hall, Inc., 1983, (ISBN 0-13-541375-3).

EXAMPLE
An example of Motorola 6805 assembly code.

one:	.space	1		! a-port
c1:	.byte	1
start:	ldx	#c1		! load address of c1
	txa
	sta	one
	add	c1		! add one
	brset	1,one,whoop	! jif bit one of aport
	bset	1,one		! set it now
	.ascii	"unused string"
whoop:	nop
	.word	start		! set vector address
	nop			! resume code

AUTHOR
Written by Gijs Mos. Not a member of the ACK group.

BUGS
The assembler has not been well tested.