## AS78K0S Assembler

####

    78K/0S REGISTER SET

    The following is a list of the 78K/0S registers used by AS78K0S:

            x(r0), a(r1),   8-bit registers
            c(r2), b(r3),
            e(r4), d(r5),
            l(r6), h(r7)

            ax(rp0),        16-bit registers
            bc(rp1),
            de(rp2),
            hl(rp3)

            sp              Stack pointer
            psw             Program status word
            cy              Carry flag

            Register names are NOT case sensitive.

####

    78K/0S INSTRUCTION SET

       The  following tables list all 78K/0S mnemonics recognized by
    the AS78K0S assembler.  The designation [] refers to a  required
    addressing  mode  argument.  The first list specifies the format
    for each addressing mode supported by AS78K0S:

            addr16          direct addressing
                            via 16-bit address

            !addr16         immediate addressing
                            only required for the
                            long br instruction

            @saddr          short direct addressing
                            0xFE20 <= saddr <= 0xFF1F

            @saddr.bit      short direct addressing
            @saddr,bit      with bit addressing (0-7)
                            0xFE20 <= saddr <= 0xFF1F

            *sfr            special function registers
                            0xFF00 <= sfr <= 0xFFCF  or
                            0xFFE0 <= sfr <= 0xFFFF

            *sfr.bit        special function registers
            *sfr,bit        wiht bit addressing (0-7)
                            0xFF00 <= sfr <= 0xFFCF  or
                            0xFFE0 <= sfr <= 0xFFFF

            label           branch label
                            (pc relative addressing)

            #byte           immediate data (8  bit)
            #word           immediate data (16 bit)

            rn              registers (8 bit)
                            x, a, c, b, e, d, l, h
                            r0-r7

            rpn             registers (16 bit)
                            ax, bc, de, hl
                            rp0-rp3

            sp              stack pointer

            psw             program status register

            cy              carry flag

            [DE], [HL]      register indirect addressing

            [HL+byte]       based register indirect addressing

    The terms addr16, saddr, sfr, bit, label, byte, and word may all
    be expressions.

       Absolute  addresses  (CONSTANTS)  will be checked as being in
    the 'saddr' range first and then as being in the 'sfr' range  if
    no explicit @ or * is specified.

       The  bit addressing modes *sfr.bit and @saddr.bit use the '.'
    as a seperator from the address and  the  bit  value.   The  bit
    value  can  be  a numeric constant, a named constant, an expres-
    sion, or a combination of these.  Because  the  '.'  is  also  a
    legal character in a name or label the assembler may not be able
    to resolve the address and bit value.  The  optional  method  of
    using a ',' to seperate the address and bit value may be used in
    this case.

       If  the 'sfr' or 'saddr' address is external then the user is
    responsible to ensure the addresses are in  the  proper  ranges.
    NO ERRORS will be reported by the linker.

       Note  that  not all addressing modes are valid with every in-
    struction, refer to the 78K/0S technical data for valid modes.

####

    Inherent Instructions

            nop     halt    stop
            ret     reti
            di      ei

####

    Branch Instructions

            bc      label                   bnc     label
            bz      label                   bnz     label

            br      []                      dbnz    [],addr16

            bt      [],addr16               bf      [],addr16

####

    Single Operand Instructions

            inc     []                      dec     []
            incw    rpn                     dec     rpn

            set1    []                      clr1    []

            set1    cy                      clr1    cy
            not1    cy

            call    addr16                  callt   []

            push    []                      pop     []

####

    Double Operand Instructions

            movw    sp,ax                   movw    ax,sp
            movw    [],[]                   xchw    ax,rpn

            add     a,[]                    add     saddr,#byte
            addc    a,[]                    addc    saddr,#byte
            sub     a,[]                    sub     saddr,#byte
            subc    a,[]                    subc    saddr,#byte
            and     a,[]                    and     saddr,#byte
            or      a,[]                    or      saddr,#byte
            xor     a,[]                    xor     saddr,#byte
            cmp     a,[]                    cmp     saddr,#byte

            adddw   ax,#word                subw    ax,#word
            cmpw    ax,#word

            ror     a,1                     rol     a,1
            rorc    a,1                     rolc    a,1

##### Go to the Documentation Index

####

... Exit the ASxxxx Documentation

... Home Page

######

Last Updated: March 2021