AS6816 Assembler


The following is a list of the 68HC16 registers used by AS6816:  

        a,b     -       8-bit accumulators
        d       -       16-bit accumulator <a:b>
        e       -       16-bit accumulator
        x,y,z   -       index registers
        k       -       address extension register
        s       -       stack pointer
        ccr     -       condition code


   The  following  tables  list all 68HC16 mnemonics recognized by
the AS6816 assembler.  The designation [] refers to  a  required
addressing  mode  argument.   The  following  list specifies the
format for each addressing mode supported by AS6816:  

        #data           immediate data
                        byte or word data

        #xo,#yo         local immediate data (mac / rmac)

        label           branch label

        r               register

        ,x              zero offset register indexed addressing

        offset,x        register indexed addressing
                             0 <= offset <= 255   ---  8-bit
                        -32768 <= offset <= -1    --- 16-bit
                           256 <= offset <= 32767 --- 16-bit
                        (external definition of offset
                         uses 16-bit mode)

        offset,x8       unsigned 8-bit offset indexed addressing
        offset,x16      signed 16-bit offset indexed addressing

        e,x             accumulator offset indexed addressing

        ext             extended addressing

        bank            64K bank number (jmp / jsr)

The  terms data, label, offset, bank, and ext may all be expres-

   Note  that  not all addressing modes are valid with every in-
struction, refer to the 6816 technical data for valid modes.  

Instruction Notes 

   Several  instructions  have  argument  conditions that can be
confusing to the uninitiated.  The AIS, AIX, AIY, AIZ, ADDD, and
ADDE instructions have 8 and 16 bit immediate forms:  

        AIS     ii              and
        AIS     jjkk

Where  each  argument  is  sign extended to 20 bits.  This means
that the 8 bit value is between -128 and  +127  and  the  16 bit
value  is between -32768 and +32765.  The assembler checks for a
constant argument with a value from -128 to +127 and  emits  the
8 bit  opcode and signed 8 bit value.  This implies that that an
argument  0xFC, often used to specify a value of -4 when dealing
with  8 bit  arguments,  is not -4 but +252.  The assembler will
emit the 16 bit opcode and the value 0x00FC, not  what  was  ex-

Inherent Instructions 

        aba             abx             aby             abz
        ace             aced            ade             adx
        ady             adz             aex             aey
        aez             bgnd            cba             daa
        ediv            edivs           emul            emuls
        fdiv            fmuls           idiv            ldhi
        lpstop          mul             nop             psha
        pshb            pshmac          pula            pulb
        pulmac          rtr             rts             sba
        sde             sted            swi             sxt
        tab             tap             tba             tbek
        tbsk            tbxk            tbyk            tbzk
        tde             tdmsk           tdp             ted
        tedm            tekb            tem             tmer
        tmet            tmxed           tpa             tpd
        tskb            tsx             tsy             tsz
        txkb            txs             txy             txz
        tykb            tys             tyx             tyz
        tzkb            tzs             tzx             tzy
        wai             xgab            xgde            xgdx
        xgdy            xgdz            xgex            xgey

Push/Pull Multiple Register Instructions 

        pshm    r,...           pulm    r,...

Short Branch Instructions 

        bcc     label           bcs     label
        beq     label           bge     label
        bgt     label           bhi     label
        bhis    label           bhs     label
        ble     label           blo     label
        blos    label           bls     label
        blt     label           bmi     label
        bne     label           bpl     label
        bra     label           brn     label
        bvc     label           bvs     label
        bsr     label

Long Branch Instructions 

        lbcc    label           lbcs    label
        lbeq    label           lbge    label
        lbgt    label           lbhi    label
        lbhis   label           lbhs    label
        lble    label           lblo    label
        lblos   label           lbls    label
        lblt    label           lbmi    label
        lbne    label           lbpl    label
        lbra    label           lbrn    label
        lbvc    label           lbvs    label
        lbsr    label

Bit Manipulation Instructions 

        bclr    [],#data
        bset    [],#data

        brclr   [],#data,label
        brset   [],#data,label

Single Operand Instructions 

        asla                    aslb
        asld                    asle
        asl     []              aslw    []

        asra                    asrb
        asrd                    asre
        asr     []              asrw    []

        clra                    clrb
        clrd                    clre
        clr     []              clrw    []

        coma                    comb
        comd                    come
        com     []              comw    []

        deca                    decb
        dec     []              decw    []

        inca                    incb
        inc     []              incw    []

        lsla                    lslb
        lsld                    lsle
        lsl     []              lslw    []

        lsra                    lsrb
        lsrd                    lsre
        lsr     []              lsrw    []

        nega                    negb
        negd                    nege
        neg     []              negw    []

        rola                    rolb
        rold                    role
        rol     []              rolw    []

        rora                    rorb
        rord                    rore
        ror     []              rorw    []

        tsta                    tstb
        tsta                    tste
        tst     []              tstw    []

Double Operand Instructions 

        adca    []              adcb    []
        adcd    []              adce    []

        adda    []              addb    []
        addd    []              adde    []

        anda    []              andb    []
        andd    []              ande    []

        bita    []              bitb    []

        cmpa    []              cmpb    []
        cpd     []              cpe     []

        eora    []              eorb    []
        eord    []              eore    []

        ldaa    []              ldab    []
        ldd     []              lde     []

        oraa    []              orab    []
        ord     []              ore     []

        sbca    []              sbcb    []
        sbcd    []              sbce    []

        staa    []              stab    []
        std     []              ste     []

        suba    []              subb    []
        subd    []              sube    []

Index/Stack Register Instructions 

        cps     []              cpx     []
        cpy     []              cpz     []

        lds     []              ldx     []
        ldy     []              ldz     []

        sts     []              stx     []
        sty     []              stz     []

Jump and Jump to Subroutine Instructions 

        jmp     bank,[]         jsr     bank,[]

Condition Code Register Instructions 

        andp    #data           orp     #data

Multiply and Accumulate Instructions 

        mac     #data           rmac    #data
        mac     #xo,#yo         rmac    #xo,#yo

Go to the Documentation Index

... Exit the ASxxxx Documentation

... Home Page

Last Updated: March 2021