Zilog Logo

Zilog Z8 Assembler Syntax

This page is typed and converted to HTML by Thomas Scherrer in 1996.
All info here is from the ZILOG book: Z8 Microcontrollers nr: Q2/95 UM95Z80010.


ASM: Is the assembler source code
OBJ: Is the object code (binary executable)

Select the Mnemonic you want detailed info about:

  • ADC ADD WITH CARRY
  • ADD ADD
  • AND LOGICAL AND

  • CALL CALL SUB ROUTINE
  • CCF COMPLEMENT CARRY FLAG
  • CLR CLEAR
  • COM COMPLEMENT
  • CP COMPARE

  • DA DECIMAL ADJUST
  • DEC DECREMENT
  • DECW DECREMENT WORD
  • DI DISABLE INTERRUPS
  • DJNZ DEC JUMP NON-ZERO

  • EI ENABLE INTERRUPS
  • HALT HALT
  • INC INCREMENT
  • INCW INCREMENT WORD
  • IRET INTERRUPT RETURN
  • JP JUMP
  • JR JUMP RELATIVE

  • LD LOAD
  • LDC LOAD CONSTANT
  • LDCI LOAD CONSTANT AUTOINCREMENT
  • LDE LOAD EXTERNAL
  • LDEI LOAD EXTERNAL AUTOINCREMENT

  • NOP NO OPERATION
  • OR BIT SET

  • POP POP FROM STACK
  • PUSH PUSH INTO STACK

  • RCF RESET CARRY FLAG
  • RET RETURN FROM SUB ROUTINE
  • RL ROTATE LEFT
  • RLC ROTATE LEFT THROUGH CARRY
  • RR ROTATE RIGHT
  • RRC ROTATE RIGHT THROUGH CARRY

  • SBC SUBTRACT WITH CARRY
  • SCF SET CARRY FLAG
  • SRA SHIFT RIGHT ARITHMETIC
  • SRP SET REG POINTER
  • STOP STOP
  • SUB SUBTRACT
  • SWAP SWAP NIBBLES

  • TCM TEST COMPLEMENT MASK
  • TM TEST MASK

  • WDH WATCH DOG ENABLE DURING HALT
  • WDT WATCH DOG ENABLE OR REFRESH TIMER

    NOTE: Working Register means one of the 16 registers(0 to F), selected by the Register Pointer RP.
    NOTE: When a Register is accessed direct, it can have a number from $00 to $FF, (0-255).


    Detailed info LD

    Instruction Format:
                                     OPC  Address Mode
                            Cycles  (hex)  dst    src
                           ---------------------------
    6 rC r IM
    6 r8 r R
    6 r9 R* r
    6 E3 r Ir
    6 F3 Ir r
    10 E4 R R
    10 E5 R IR
    10 E6 R IM
    10 E7 IR IM
    10 F5 IR R
    10 C7 r X
    10 D7 X r
    r is 0 to F
    R is 00 to FF


    Operation: dst <-- src

    The contest of the source operand are loaded into the destination operand. The contents of the source operand are not affected.


    Flags:

    C: Unaffected.
    Z: Unaffected.
    S: Unaffected.
    V: Unaffected.
    D: Unaffected.
    H: Unaffected.


    Note: Address modes R or IR can be used to specify a 4-bit Working Register. In this format, the source or destination Working Register operand is specified by adding 1110B(Eh) to the high nibble of the operand. For example, if Working Register R12(Ch) is the destination operand, then ECh will be used as the destination operand in the OpCode.


    Example: The statement:

    ASM: LD R15,#34H

    OBJ: FC 34

    Loads the value 34H into working register R15.


    Example: If register 34H contains the value FCH, the statement:

    ASM: LD R14,34H
    OBJ: F8 34

    Loads the value FCH into working register R15. The contents of register 34H are not affected.


    Example: If working register R14 contains the value 45H, the statement:

    ASM: LD 34H,R14
    OBJ: E9 34

    Loads the value 45H into register 34H. The contents of working register R14 are not affected.


    Example: If working register R12 contains the value 34H, and Register 34H contains the value FFH, the statement:

    ASM: LD R13,@R12
    OBJ: E3 DC

    Loads the value FFH into working register R13. The contents of working register R12 and R34 are not affected.


    Example: If working register R13 contains the value 45h, and working Register R12 contains the value 00h, the statement:

    ASM: LD @R13,R12
    OBJ: F3 DC

    Loads the value 00h into register 45h. The contents of working register R12 and R13 are not affected.


    Example: If register 45h contains the value CFh, the statement:

    ASM: LD 34H,45H
    OBJ: E4 45 34

    Loads the value CFh into register 34h. The contents of working register 45h are not affected.


    Example: If register 45h contains the value CFh, and register contains the value FFh, the statement:

    ASM: LD 34H,@45H
    OBJ: E5 45 34

    Loads the value FFh into register 34h. The contents of register 45h and CFh are not affected.


    Example: The statement:

    ASM: LD 34H,#A4H
    OBJ: E6 34 A4

    Loads the value A4h into register 34h.


    Example: If working register R14 contains the value 7Fh, the statement:

    ASM: LD @R14,#FCH
    OBJ: E7 EE FC

    Loads the value FCh into register 7Fh. The contents of working register R14 are not affected.


    Example: If register 34h contains the value CFh, and Register 45h contains the value FFh, the statement:

    ASM: LD @34H,45H
    OBJ: F5 45 34

    Loads the value FFh into register CFh. The contents of register 34h and 45h are not affected.


    Example: If working register R0 contains the value 08h, and Register 2Ch (24h + 08h = 2Ch) contains the value 4Fh, the statement:

    ASM: LD R10,24H(R0)
    OBJ: C7 A0 24

    Loads working register R10 with the value 4Fh. The contents ofworking register R0 and register 2Ch are not affected.


    Example: If working register R0 contains the value 0Bh, and working Register R10 contains 83h, the statement:

    ASM: LD F0H(R0),R10
    OBJ: D7 A0 F0

    Loads the value 83h into register FBh (F0h + 0Bh = FBh). Since this is the interrupt mask register, the LOAD statement has the effect of enabligg IRQ0 and IRQ1. The contents of working registers R0 and R10 are unaffected by this load.


    Detailed info LDC

    Instruction Format:
    
    


    This page hosted by Get your own Free Home Page
    Hosted by www.Geocities.ws

    1